aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/init.vim
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-04-07 14:24:58 +0200
committerKarel Kočí <cynerd@email.cz>2024-04-07 14:24:58 +0200
commite1e143bc63895d96fa9dc86416437d11ba130e16 (patch)
tree03345eae1a469d1692d33c16b23bd72d9e48304f /config/nvim/init.vim
parent7e0877988e4f1104d4f13f1b157ace744302fcc9 (diff)
downloadmyconfigs-e1e143bc63895d96fa9dc86416437d11ba130e16.tar.gz
myconfigs-e1e143bc63895d96fa9dc86416437d11ba130e16.tar.bz2
myconfigs-e1e143bc63895d96fa9dc86416437d11ba130e16.zip
nvim: improve telescope file open
Diffstat (limited to 'config/nvim/init.vim')
-rw-r--r--config/nvim/init.vim9
1 files changed, 1 insertions, 8 deletions
diff --git a/config/nvim/init.vim b/config/nvim/init.vim
index 491ae47..77e572d 100644
--- a/config/nvim/init.vim
+++ b/config/nvim/init.vim
@@ -136,20 +136,13 @@ let g:UltiSnipsJumpBackwardTrigger='<c-k>'
" Telescope
nnoremap <c-c><c-c> :Telescope buffers<cr>
-nnoremap <c-p> :call TelescopeFiles()<cr>
+nnoremap <c-p> :lua require('mytelescopefiles')()<cr>
nnoremap <c-s-p> :Telescope lsp_document_symbols<cr>
nmap <leader>] :Telescope lsp_definitions<cr>
nmap <leader><leader>] :Telescope lsp_type_definitions<cr>
nmap <leader>[ :Telescope lsp_implementations<cr>
nmap <leader><leader>[ :Telescope lsp_references<cr>
nmap <F9> :Telescope diagnostics bufnr=0<cr>
-function TelescopeFiles()
- if stridx(system('git rev-parse --is-inside-work-tree 2>/dev/null || true'), 'true') != -1
- lua require('telescope.builtin').git_files{use_file_path=true,git_command={"sh","-c","git ls-files -c --recurse-submodules && git ls-files -o --exclude-standard"}}
- else
- lua require('telescope.builtin').find_files{}
- endif
-endfunction
" Copy line location
nmap <leader><leader>c :let @+=expand("%:p") . ":" . line(".")<cr>