diff options
Diffstat (limited to 'files/nvim')
| -rw-r--r-- | files/nvim/init.vim | 13 | ||||
| -rw-r--r-- | files/nvim/mini_starter_picture.diff | 34 |
2 files changed, 28 insertions, 19 deletions
diff --git a/files/nvim/init.vim b/files/nvim/init.vim index 7325928..780f9d5 100644 --- a/files/nvim/init.vim +++ b/files/nvim/init.vim @@ -25,6 +25,9 @@ set nocompatible filetype plugin indent on syntax on +" Check for SHIFT_JIS. +set fileencodings=ucs-bom,utf-8,sjis,default,latin1 + " 4 spaces autoindent. set tabstop=4 set shiftwidth=4 @@ -121,7 +124,7 @@ let g:fzf_colors = { \'spinner': ['fg', 'String'], \'header': ['fg', 'Type'] \} -let g:fzf_preview_window = ['right,47%'] +let g:fzf_preview_window = ['right,55%'] " This is redundant but I want to keep FZF_DEFAULT_OPTS here. let $FZF_DEFAULT_OPTS = '--preview-window=border-sharp' let g:fzf_layout = { @@ -155,7 +158,7 @@ function! Statusline() abort let status .= '%=' let status .= ' %y' let status .= '%{StatuslineLsp()}' - let status .= ' %{&fileencoding?&fileencoding:&encoding}' + let status .= ' %{&fileencoding}' let status .= '[%{&fileformat}]' let status .= '%3p%%' let status .= ' %3l:%-3c' @@ -202,6 +205,7 @@ nmap <silent> <C-i> :GGrep<CR> nmap <silent> <C-\> :GFiles<CR> " Only Neogit bind, handle all further operations from this menu. nmap <silent> Y :Neogit<CR> +nmap <silent> L :lua neogit_log_current()<CR> " Undotree. nmap <silent> U :UndotreeToggle<CR> " Toggle hex color highlighting. @@ -354,6 +358,11 @@ require('neogit').setup({ integrations = {} }) +-- Doesn't work consistently. +function neogit_log_current() + require("neogit").action("log", "log_current", { "--", vim.fn.expand("%:p") })() +end + -- Preview colors in #<hex> format. require('ccc').setup({ highlighter = { auto_enable = false, lsp = true } }) EOF diff --git a/files/nvim/mini_starter_picture.diff b/files/nvim/mini_starter_picture.diff index b64025c..2efc2a1 100644 --- a/files/nvim/mini_starter_picture.diff +++ b/files/nvim/mini_starter_picture.diff @@ -1,5 +1,5 @@ diff --git a/lua/mini/starter.lua b/lua/mini/starter.lua -index cc10d101..78c4e5c1 100644 +index 66d46a52..9b7e4397 100644 --- a/lua/mini/starter.lua +++ b/lua/mini/starter.lua @@ -138,7 +138,7 @@ @@ -11,7 +11,7 @@ index cc10d101..78c4e5c1 100644 --- timer:stop() --- return --- end -@@ -248,6 +248,9 @@ MiniStarter.config = { +@@ -239,6 +239,9 @@ MiniStarter.config = { -- If `nil` (default), default items will be used (see |mini.starter|). items = nil, @@ -21,7 +21,7 @@ index cc10d101..78c4e5c1 100644 -- Header to be displayed before items. Converted to single string via -- `tostring` (use `\n` to display several lines). If function, it is -- evaluated first. If `nil` (default), polite greeting will be used. -@@ -258,6 +261,12 @@ MiniStarter.config = { +@@ -249,6 +252,12 @@ MiniStarter.config = { -- evaluated first. If `nil` (default), default usage help will be shown. footer = nil, @@ -34,7 +34,7 @@ index cc10d101..78c4e5c1 100644 -- Array of functions to be applied consecutively to initial content. -- Each function should take and return content for Starter buffer (see -- |mini.starter| and |MiniStarter.get_content()| for more details). -@@ -382,7 +391,7 @@ MiniStarter.refresh = function(buf_id) +@@ -373,7 +382,7 @@ MiniStarter.refresh = function(buf_id) data.footer = H.normalize_header_footer(config.footer or H.default_footer) -- Evaluate content @@ -43,7 +43,7 @@ index cc10d101..78c4e5c1 100644 local hooks = config.content_hooks or H.default_content_hooks for _, f in ipairs(hooks) do content = f(content, buf_id) -@@ -409,6 +418,16 @@ MiniStarter.refresh = function(buf_id) +@@ -400,6 +409,16 @@ MiniStarter.refresh = function(buf_id) -- Apply current query (clear command line afterwards) H.make_query(buf_id) @@ -60,7 +60,7 @@ index cc10d101..78c4e5c1 100644 end --- Close Starter buffer -@@ -738,18 +757,45 @@ MiniStarter.gen_hook.aligning = function(horizontal, vertical) +@@ -729,18 +748,45 @@ MiniStarter.gen_hook.aligning = function(horizontal, vertical) local win_id = vim.fn.bufwinid(buf_id) if win_id < 0 then return end @@ -108,7 +108,7 @@ index cc10d101..78c4e5c1 100644 return MiniStarter.gen_hook.padding(left_pad, top_pad)(content) end end -@@ -1012,7 +1058,7 @@ H.default_footer = [[ +@@ -1003,7 +1049,7 @@ H.default_footer = [[ Type query to filter items <BS> deletes latest character from query <Esc> resets current query @@ -117,7 +117,7 @@ index cc10d101..78c4e5c1 100644 <CR> executes action of current item <C-c> closes this buffer]] -@@ -1053,8 +1099,54 @@ end +@@ -1044,8 +1090,54 @@ end H.apply_config = function(config) MiniStarter.config = config end @@ -173,7 +173,7 @@ index cc10d101..78c4e5c1 100644 if config.autoopen then local on_vimenter = function() -@@ -1066,7 +1158,7 @@ H.create_autocommands = function(config) +@@ -1057,7 +1149,7 @@ H.create_autocommands = function(config) vim.cmd('noautocmd lua MiniStarter.open()') end @@ -182,7 +182,7 @@ index cc10d101..78c4e5c1 100644 vim.api.nvim_create_autocmd('VimEnter', au_opts) end -@@ -1112,9 +1204,11 @@ H.normalize_header_footer = function(x) +@@ -1103,9 +1195,11 @@ H.normalize_header_footer = function(x) end -- Work with buffer content --------------------------------------------------- @@ -195,7 +195,7 @@ index cc10d101..78c4e5c1 100644 -- Add header lines for _, l in ipairs(header) do H.content_add_line(content, { H.content_unit(l, 'header', 'MiniStarterHeader') }) -@@ -1125,7 +1219,7 @@ H.make_initial_content = function(header, items, footer) +@@ -1116,7 +1210,7 @@ H.make_initial_content = function(header, items, footer) H.content_add_items(content, items) -- Add footer lines @@ -204,7 +204,7 @@ index cc10d101..78c4e5c1 100644 for _, l in ipairs(footer) do H.content_add_line(content, { H.content_unit(l, 'footer', 'MiniStarterFooter') }) end -@@ -1328,11 +1422,23 @@ H.make_buffer_autocmd = function(buf_id) +@@ -1319,11 +1413,23 @@ H.make_buffer_autocmd = function(buf_id) au('VimResized', function() MiniStarter.refresh(buf_id) end, 'Refresh') au('CursorMoved', function() H.position_cursor_on_current_item(buf_id) end, 'Position cursor') @@ -228,7 +228,7 @@ index cc10d101..78c4e5c1 100644 end H.apply_buffer_options = function(buf_id) -@@ -1345,7 +1451,7 @@ H.apply_buffer_options = function(buf_id) +@@ -1336,7 +1442,7 @@ H.apply_buffer_options = function(buf_id) vim.api.nvim_feedkeys('\28\14', 'nx', false) -- Having `noautocmd` is crucial for performance: ~9ms without it, ~1.6ms with it @@ -237,7 +237,7 @@ index cc10d101..78c4e5c1 100644 local options = { -- Taken from 'vim-startify' -@@ -1392,12 +1498,8 @@ H.apply_buffer_mappings = function(buf_id) +@@ -1383,12 +1489,8 @@ H.apply_buffer_mappings = function(buf_id) buf_keymap('<CR>', 'MiniStarter.eval_current_item()') @@ -252,7 +252,7 @@ index cc10d101..78c4e5c1 100644 -- Make all special symbols to update query for _, key in ipairs(vim.split(H.get_config().query_updaters, '')) do -@@ -1473,21 +1575,21 @@ H.is_something_shown = function() +@@ -1464,21 +1566,21 @@ H.is_something_shown = function() end -- Utilities ------------------------------------------------------------------ @@ -265,7 +265,7 @@ index cc10d101..78c4e5c1 100644 end -H.set_buf_name = function(buf_id, name) vim.api.nvim_buf_set_name(buf_id, 'ministarter://' .. buf_id .. '/' .. name) end -+H.set_buf_name = function(buf_id, name) vim.api.nvim_buf_set_name(buf_id, 'dashboard://' .. buf_id .. '/' .. name) end ++H.set_buf_name = function(buf_id, name) vim.api.nvim_buf_set_name(buf_id, '*dashboard*') end H.echo = function(msg, is_important) if H.get_config().silent then return end @@ -277,7 +277,7 @@ index cc10d101..78c4e5c1 100644 -- Avoid hit-enter-prompt local max_width = vim.o.columns * math.max(vim.o.cmdheight - 1, 0) + vim.v.echospace -@@ -1536,7 +1638,7 @@ H.eval_fun_or_string = function(x, string_as_cmd) +@@ -1527,7 +1629,7 @@ H.eval_fun_or_string = function(x, string_as_cmd) if type(x) == 'function' then return x() end if type(x) == 'string' then if string_as_cmd then |