diff --git a/nvim/after/ftplugin/fugitive.vim b/nvim/after/ftplugin/fugitive.vim new file mode 100644 index 0000000..ab49c88 --- /dev/null +++ b/nvim/after/ftplugin/fugitive.vim @@ -0,0 +1 @@ +setlocal nofoldenable foldmethod=manual diff --git a/nvim/after/ftplugin/haskell.vim b/nvim/after/ftplugin/haskell.vim index bdabaed..8d98c34 100644 --- a/nvim/after/ftplugin/haskell.vim +++ b/nvim/after/ftplugin/haskell.vim @@ -1,3 +1 @@ -let g:haskall_test = 1 -setlocal foldmethod< -setlocal foldtext< +setlocal foldmethod< foldtext< diff --git a/nvim/after/syntax/cabal.vim b/nvim/after/syntax/cabal.vim index 8ced55f..8d98c34 100644 --- a/nvim/after/syntax/cabal.vim +++ b/nvim/after/syntax/cabal.vim @@ -1,2 +1 @@ -setlocal foldmethod< -setlocal foldtext< +setlocal foldmethod< foldtext< diff --git a/nvim/after/syntax/cabalconfig.vim b/nvim/after/syntax/cabalconfig.vim index 8ced55f..8d98c34 100644 --- a/nvim/after/syntax/cabalconfig.vim +++ b/nvim/after/syntax/cabalconfig.vim @@ -1,2 +1 @@ -setlocal foldmethod< -setlocal foldtext< +setlocal foldmethod< foldtext< diff --git a/nvim/after/syntax/nginx.vim b/nvim/after/syntax/nginx.vim index 1e4e3af..bf72a83 100644 --- a/nvim/after/syntax/nginx.vim +++ b/nvim/after/syntax/nginx.vim @@ -4,5 +4,4 @@ " sourced in `syntax/nginx.vim` in vim-polyglot, which resets the `commentstring` " set in `ftplugin/nginx.vim` and sets `comments` to some garbage. This script " undoes that damage. -setlocal comments< -setlocal commentstring=#%s +setlocal comments< commentstring=#%s diff --git a/nvim/dotfiles/plugins-list.vim b/nvim/dotfiles/plugins-list.vim index 36c17c6..ccd39a0 100644 --- a/nvim/dotfiles/plugins-list.vim +++ b/nvim/dotfiles/plugins-list.vim @@ -45,9 +45,6 @@ Plug 'vim-airline/vim-airline' Plug 'tpope/vim-obsession' Plug 'romainl/vim-qf' - if g:vim_ide - Plug 'dyng/ctrlsf.vim' - endif " }}} " Git {{{ diff --git a/nvim/plugin/editing.vim b/nvim/plugin/editing.vim index 59b18d3..46cbe9b 100644 --- a/nvim/plugin/editing.vim +++ b/nvim/plugin/editing.vim @@ -58,23 +58,17 @@ set commentstring=//%s " Cursor and Scrolling {{{ - - set number - set relativenumber - set cursorline - + set number relativenumber cursorline " remember cursor position augroup vimrc-editing-remember-cursor-position autocmd! autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exec "normal! g`\"" | endif augroup END - " }}} " Wrapping {{{ - set nowrap - set colorcolumn=81,101,121 + set nowrap colorcolumn=81,101,121 " }}} diff --git a/nvim/plugin/files.vim b/nvim/plugin/files.vim index 14fa58f..da700db 100644 --- a/nvim/plugin/files.vim +++ b/nvim/plugin/files.vim @@ -20,6 +20,23 @@ nnoremap empty(&buftype) ? ":writewall\" : "\" command! -bang -nargs=* Rg call fzf#vim#grep(s:rg_cmd . ' --column --line-number --no-heading --fixed-strings --smart-case --color always ' . shellescape(), 1, 0) command! -bang -nargs=* Find Rg endif + + nnoremap / :grep + + function! s:grep_mapping_star_normal() + let word = expand("") + if !empty(word) + call feedkeys(":\grep " . shellescape('\b' . word . '\b'), 'n') + endif + endfunction + function! s:grep_mapping_star_visual() + let tmp = @" + normal! y + call feedkeys(":\grep " . shellescape(@"), 'n') + let @" = tmp + endfunction + nnoremap * call grep_mapping_star_normal() + xnoremap * call grep_mapping_star_visual() " }}} @@ -29,7 +46,10 @@ nnoremap empty(&buftype) ? ":writewall\" : "\" let g:loaded_netrwPlugin = 1 " re-add Netrw's gx mappings since we've disabled them nnoremap gx call netrw#BrowseX(expand(''),netrw#CheckIfRemote()) - xnoremap gx call netrw#BrowseXVis() + " This one can be rewritten in a way to not clobber the yank register... + " Most notably, the built-in mapping, which uses netrw#BrowseXVis(), doesn't + " work and breaks the editor, at least for me. + xnoremap gx y:call netrw#BrowseX(@",netrw#CheckIfRemote()) " }}} @@ -176,10 +196,3 @@ nnoremap empty(&buftype) ? ":writewall\" : "\" augroup END " }}} - - -" CtrlSF {{{ - nmap / CtrlSFPrompt - nmap * CtrlSFCwordPath - xmap * CtrlSFVwordPath -" }}}