aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/init.vim
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-02-27 09:01:40 +0100
committerKarel Kočí <cynerd@email.cz>2024-02-27 09:01:40 +0100
commite7f3a7bec28f86d362c418c12658d672903223a7 (patch)
tree7696eaa72a408dcb660c43c750059d4164fca6e6 /config/nvim/init.vim
parent1970054228b3a9a3a8fc99af723ee13c147e7747 (diff)
downloadmyconfigs-e7f3a7bec28f86d362c418c12658d672903223a7.tar.gz
myconfigs-e7f3a7bec28f86d362c418c12658d672903223a7.tar.bz2
myconfigs-e7f3a7bec28f86d362c418c12658d672903223a7.zip
Few more nvim updates
Diffstat (limited to 'config/nvim/init.vim')
-rw-r--r--config/nvim/init.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/nvim/init.vim b/config/nvim/init.vim
index b538453..1d0e6c6 100644
--- a/config/nvim/init.vim
+++ b/config/nvim/init.vim
@@ -24,8 +24,8 @@ set wildmenu
set modeline
set encoding=utf-8
-
set backspace=indent,eol,start
+set completeopt=menu,menuone,preview,noselect,noinsert
colorscheme nord
let g:lightline = { 'colorscheme': 'nord' }
@@ -117,12 +117,19 @@ nmap <leader>f <Plug>(ale_fix)
" Telescope
nnoremap <c-c><c-c> :Telescope buffers<cr>
-nnoremap <expr> <c-p> ":lua require'telescope.builtin'.git_files{}<cr>".expand('%:h')."/"
+nnoremap <expr> <c-p> ":call TelescopeFiles()<cr>".expand('%:h')."/"
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>
+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
" TODO this should work but it doesn't for some reason