51cb2c9ad3
Migrate Neovim CtrlP to FinderF
...
Way faster and matches my own preferences. Has a preview and pop up in
the center of the screen.
Comes with many other modes like colorscheme, help, line, etc.
diff --git a/home/programs/neovim.nix b/home/programs/neovim.nix
index 55783de..dda525c 100644
--- a/home/programs/neovim.nix
+++ b/home/programs/neovim.nix
@@ -239,8 +239,8 @@ in {
}
{
- plugin = ctrlp-vim;
- config = pkgs.lib.fileContents ./neovim/plugins/ctrlp.vim;
+ plugin = LeaderF;
+ config = pkgs.lib.fileContents ./neovim/plugins/leaderf.vim;
}
# Syntax
diff --git a/home/programs/neovim/config/functions.vim b/home/programs/neovim/config/functions.vim
index 24e0c00..fea577b 100644
--- a/home/programs/neovim/config/functions.vim
+++ b/home/programs/neovim/config/functions.vim
@@ -113,7 +113,7 @@ function! StartProfiling()
execute(':profile file *')
endfunc
-function! CtrlPCurrentComposerPackage()
+function! LeaderfCurrentComposerPackage()
let l:filePath = split(expand('%:p:h'), '/')
while !filereadable('/' . join(l:filePath + ['composer.json'], '/')) && len(l:filePath)
@@ -121,7 +121,7 @@ function! CtrlPCurrentComposerPackage()
endwhile
if len(l:filePath)
- execute(':CtrlP /' . join(l:filePath, '/'))
+ execute(':LeaderfFile /' . join(l:filePath, '/'))
else
echom 'No composer package detected.'
endif
diff --git a/home/programs/neovim/config/mappings.vim b/home/programs/neovim/config/mappings.vim
index bd3aee9..7b7ad7d 100644
--- a/home/programs/neovim/config/mappings.vim
+++ b/home/programs/neovim/config/mappings.vim
@@ -10,10 +10,11 @@ nnoremap <leader>v :set paste!<cr>
nnoremap <leader>nh :nohlsearch<cr>
" Configure navigation, e.g. go to buffer, file, ...
-nnoremap <leader>p :CtrlP<cr>
-nnoremap <leader>l :CtrlPBuffer<cr>
-nnoremap <leader>r :CtrlPBufTag<cr>
-nnoremap <silent> <leader>c :call CtrlPCurrentComposerPackage()<cr>
+nnoremap <leader>pp :LeaderfSelf<cr>
+nnoremap <leader>pf :LeaderfFile<cr>
+nnoremap <leader>pb :LeaderfBuffer<cr>
+nnoremap <leader>pt :LeaderfBufTag<cr>
+nnoremap <silent> <leader>pc :call LeaderfCurrentComposerPackage()<cr>
nnoremap <leader>k :NERDTreeToggle<cr>
nnoremap <leader>f :NERDTreeFind<cr>
diff --git a/home/programs/neovim/plugins/ctrlp.vim b/home/programs/neovim/plugins/ctrlp.vim
deleted file mode 100644
index c45b87e..0000000
--- a/home/programs/neovim/plugins/ctrlp.vim
+++ /dev/null
@@ -1,26 +0,0 @@
-let g:ctrlp_follow_symlinks = 2
-" Default to regex mode
-let g:ctrlp_regexp = 1
-let g:ctrlp_match_window = 'top,order:ttb,min:1,max:10'
-" let g:ctrlp_open_new_file = '0'
-" let g:ctrlp_lazy_update = 1
-let g:ctrlp_show_hidden = 1
-
-let g:ctrlp_types = ['fil', 'buf', 'buftag']
-
-let g:ctrlp_working_path_mode = 'w'
-let g:ctrlp_max_files = 0
-let g:ctrlp_clear_cache_on_exit = 0
-
-" Configure completion for tags in buffer,
-" e.g. configure which kinds to complete for css.
-let g:ctrlp_buftag_types = {
- \ 'css' : '--css-types=vcit',
- \ 'typescript' : '--typescript-types=cnfvmitesod',
- \ 'xml' : '--xml-types=ci',
- \ 'rst' : '--reStructuredText-types=csSt',
- \ 'markdown' : '--Markdown-types=csStT',
- \ 'fluid' : '--xml-types=si',
- \ 'apache' : '--apache-types=s',
- \ 'yaml' : '--yaml-types=t',
-\ }
diff --git a/home/programs/neovim/plugins/leaderf.vim b/home/programs/neovim/plugins/leaderf.vim
new file mode 100644
index 0000000..7627b07
--- /dev/null
+++ b/home/programs/neovim/plugins/leaderf.vim
@@ -0,0 +1,213 @@
+let g:Lf_WorkingDirectoryMode = 'c'
+
+let g:Lf_FollowLinks = 1
+let g:Lf_ShowHidden = 1
+
+let g:Lf_WindowPosition = 'popup'
+let g:Lf_HideHelp = 1
+
+let g:Lf_GtagsAutoUpdate = 0
+
+let g:Lf_IgnoreCurrentBufferName = 1
+
+let g:Lf_ShowDevIcons = 0
+
+" TODO: Try to port to existing colorscheme, does it work with load order?
+let g:Lf_PopupPalette = {
+ \ 'dark': {
+ \ 'Lf_hl_popup_inputText': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_window': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_blank': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_cursor': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_prompt': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_spin': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_normalMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_inputMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_category': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_nameOnlyMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_fullPathMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_fuzzyMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_regexMode': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_cwd': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_lineInfo': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_popup_total': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_cursorline': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': '235',
+ \ },
+ \ 'Lf_hl_selection': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match0': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match1': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match2': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match3': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match4': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_match': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'blue',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_lineLocation': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_previewTitle': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_winNumber': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_winIndicators': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_winModified': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_winNomodifiable': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_winDirname': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_quickfixFileName': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_quickfixLineNumber': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_quickfixColumnNumber': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_loclistFileName': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_loclistLineNumber': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ 'Lf_hl_loclistColumnNumber': {
+ \ 'cterm': 'none',
+ \ 'ctermfg': 'none',
+ \ 'ctermbg': 'none',
+ \ },
+ \ }
+ \ }
+
+let g:Lf_PreviewInPopup = 1
+let g:Lf_PreviewHorizontalPosition = 'center'
+let g:Lf_PreviewCode = 0
+let g:Lf_PreviewResult = {
+ \ 'File': 1,
+ \ 'Buffer': 1,
+ \ 'BufTag': 1,
+ \}
2022-03-16 09:05:13 +01:00