summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris <[email protected]>2021-03-17 03:23:23 -0400
committerChris <[email protected]>2021-03-17 03:23:23 -0400
commit784fdcf19d8fa48da50fd33dc15462f1c4da60a4 (patch)
tree4af219a151786d540f9c66492c0d230c69f55b4d
parent20b8eb1c330dbfbaf951d3a18430190bc5e51eca (diff)
updates
-rw-r--r--README.md1
-rw-r--r--lua/keymappings.lua6
-rw-r--r--lua/nv-far/init.lua66
-rw-r--r--lua/nv-utils/init.lua4
-rw-r--r--lua/plugins.lua4
-rw-r--r--vimscript/nv-whichkey/init.vim31
6 files changed, 102 insertions, 10 deletions
diff --git a/README.md b/README.md
index 04581b7b..c14239a6 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ $HOME/.config/nvim/lua/nv-vscode/init.vim
- formatting using efm server for python
- formatting using efm server for prettier/eslint
- snippet support
+- learn what opt is
**LOW PRIORITY**
- redo barbar highlight groups
diff --git a/lua/keymappings.lua b/lua/keymappings.lua
index b5a57924..8080d4b1 100644
--- a/lua/keymappings.lua
+++ b/lua/keymappings.lua
@@ -65,3 +65,9 @@ vim.cmd('inoremap <expr> <c-k> (\"\\<C-p>\")')
-- TAB Complete
--vim.api.nvim_set_keymap('i', '<expr><TAB>', 'pumvisible() ? \"\\<C-n>\" : \"\\<TAB>\"', { noremap = true, silent = true })
+vim.cmd([[
+map p <Plug>(miniyank-autoput)
+map P <Plug>(miniyank-autoPut)
+map <leader>n <Plug>(miniyank-cycle)
+map <leader>N <Plug>(miniyank-cycleback)
+]])
diff --git a/lua/nv-far/init.lua b/lua/nv-far/init.lua
new file mode 100644
index 00000000..6564d816
--- /dev/null
+++ b/lua/nv-far/init.lua
@@ -0,0 +1,66 @@
+vim.cmd([[
+set lazyredraw " improve scrolling performance when navigating through large results
+
+let g:far#window_width=50
+" Use %:p with buffer option only
+let g:far#file_mask_favorites=['%:p', '**/*.*', '**/*.js', '**/*.py', '**/*.java', '**/*.css', '**/*.html', '**/*.vim', '**/*.cpp', '**/*.c', '**/*.h', ]
+let g:far#window_min_content_width=30
+let g:far#enable_undo=1
+
+" let g:far#ignore_files=['$HOME/.config/nvim/utils/farignore']
+" let g:far#ignore_files=['node_modules/']
+
+" Below are the default mappings and corresponding variable names in
+
+" x v_x - Exclude item under the cursor.
+
+" i v_i - Include item under the cursor.
+
+" t v_t - Toggle item exclusion under the cursor.
+
+" f v_f - Smartly toggle item exclusion under the cursor: exclude all items when all are excluded, otherwise exclude all items.
+
+" X - Exclude all items.
+
+" I - Include all items.
+
+" T - Toggle exclusion for all items.
+
+" F - Smartly toggle exclusion for all items: include all items when all are excluded, otherwise exclude all items.
+
+" <CR> - Jump to the source code of the item under the cursor. See |far-jump|
+
+" p - Open preview window (if not) and scroll to the item under the cursor. See |far-preview|
+
+" P - Close preview window. See |far-preview|
+
+" CTRL-K - Scroll preview window up (if open). See |far-preview|, |g:far#preview_window_scroll_step|
+
+" CTRL-J - Scroll preview window down (if open). See |far-preview|, |g:far#preview_window_scroll_step|
+
+" zo - Expand node under the cursor.
+
+" zc - Collapse node under the cursor.
+
+" za - Toggle node expanding under the cursor.
+
+" zs - Smartly toggle exclusion for all nodes: expand all nodes when all are collapsed, otherwise collapse all nodes.
+
+" zr v_zr - Expand all nodes.
+
+" zm v_zm - Collapse all nodes.
+
+" zA v_zA - Toggle exclusion for all nodes.
+
+" zS v_zS - Smartly toggle exclusion for all nodes: expand all nodes when all are collapsed, otherwise collapse all nodes.
+
+" s v_s - Execute |:Fardo|<CR>, to replace all included items.
+
+" u v_s - Execute |:Farundo|<CR>, to undo the last replacement by |:Fardo|.
+
+" U v_U - Execute |:Farundo| --all=1<CR>, to undo all replacements by |:Fardo|. For param '--all=' see |farundo-params|.
+
+" q v_q - Close searching result buffer and its preview buffer (if exists)
+
+]])
+
diff --git a/lua/nv-utils/init.lua b/lua/nv-utils/init.lua
index fff4ded7..fa94d260 100644
--- a/lua/nv-utils/init.lua
+++ b/lua/nv-utils/init.lua
@@ -29,7 +29,9 @@ function_wrapper.define_augroups(
{'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
{'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'},
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
-
+ {'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
+ {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
+ {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
},
}
)
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 242d83c9..202574d8 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -117,5 +117,7 @@ return require('packer').startup(function(use)
--use 'suy/vim-context-commentstring'
-- use 'b3nj5m1n/kommentary'
use 'andymass/vim-matchup'
- use 'sheerun/vim-polyglot'
+ use 'junegunn/goyo.vim'
+ use 'bfredl/nvim-miniyank'
+ use 'brooth/far.vim'
end)
diff --git a/vimscript/nv-whichkey/init.vim b/vimscript/nv-whichkey/init.vim
index 6474dfb0..3b35afc1 100644
--- a/vimscript/nv-whichkey/init.vim
+++ b/vimscript/nv-whichkey/init.vim
@@ -21,26 +21,35 @@ autocmd! FileType which_key
autocmd FileType which_key set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler
-
+" " delete without yanking
+" nnoremap <leader>d "_d
+" vnoremap <leader>d "_d
+"
+" " replace currently selected text with default register
+" " without yanking it
+" vnoremap <leader>p "_dP
+" vnoremap <leader>p "_dP
+map <leader>p <Plug>(miniyank-startput)
+map <leader>P <Plug>(miniyank-startPut)
" Single mappings
-" let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ]
-" let g:which_key_map['/'] = { 'name' : 'comment' }
-
-"let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ]
let g:which_key_map['/'] = 'which_key_ignore'
+let g:which_key_map['p'] = 'which_key_ignore'
+let g:which_key_map['P'] = 'which_key_ignore'
+let g:which_key_map['n'] = 'which_key_ignore'
+let g:which_key_map['N'] = 'which_key_ignore'
let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'find current file' ]
let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ]
let g:which_key_map['f'] = [ ':Telescope find_files' , 'find files' ]
let g:which_key_map['h'] = [ '<C-W>s' , 'split below']
let g:which_key_map['m'] = [ ':MarkdownPreviewToggle' , 'markdown preview']
-let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ]
+let g:which_key_map['h'] = [ ':let @/ = ""' , 'no highlight' ]
let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ]
-let g:which_key_map['p'] = [ '"0p' , 'paste' ]
+" let g:which_key_map['p'] = [ '"0p' , 'paste' ]
" TODO create entire treesitter section
let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor' , 'treesitter highlight' ]
let g:which_key_map['v'] = [ '<C-W>v' , 'split right']
" Add Zen mode, play nice with status line
-" let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
+let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
" Group mappings
@@ -206,4 +215,10 @@ let g:which_key_map.t = {
\ }
" \ 'r' : [':FloatermNew ranger' , 'ranger'],
+let g:which_key_map.R = {
+ \ 'name' : '+Find_Replace' ,
+ \ 'f' : [':Farr --source=vimgrep' , 'file'],
+ \ 'p' : [':Farr --source=rgnvim' , 'project'],
+ \ }
+
call which_key#register('<Space>', "g:which_key_map")