From e7f3a7bec28f86d362c418c12658d672903223a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 27 Feb 2024 09:01:40 +0100 Subject: Few more nvim updates --- config/nvim/init.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'config/nvim/init.vim') 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 f (ale_fix) " Telescope nnoremap :Telescope buffers -nnoremap ":lua require'telescope.builtin'.git_files{}".expand('%:h')."/" +nnoremap ":call TelescopeFiles()".expand('%:h')."/" nnoremap :Telescope lsp_document_symbols nmap ] :Telescope lsp_definitions nmap ] :Telescope lsp_type_definitions nmap [ :Telescope lsp_implementations nmap [ :Telescope lsp_references +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 -- cgit v1.2.3