better actions and filer
This commit is contained in:
parent
8aeae726ed
commit
97abb8d8b6
2 changed files with 106 additions and 4 deletions
|
|
@ -40,6 +40,26 @@ require'compe'.setup {
|
|||
};
|
||||
}
|
||||
|
||||
signature_cfg = {
|
||||
hint_enable = true,
|
||||
hint_prefix = "% ",
|
||||
handler_opts = {
|
||||
border = "none"
|
||||
},
|
||||
}
|
||||
|
||||
require'lsp_signature'.on_attach(signature_cfg)
|
||||
|
||||
saga_cfg = {
|
||||
code_action_prompt = {
|
||||
enable = false,
|
||||
sign = false,
|
||||
virtual_text = false,
|
||||
},
|
||||
}
|
||||
require'lspsaga'.init_lsp_saga(saga_cfg)
|
||||
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
|
|
|||
90
.vimrc
90
.vimrc
|
|
@ -207,11 +207,17 @@ Plug 'nvim-lua/plenary.nvim'
|
|||
Plug 'nvim-telescope/telescope.nvim'
|
||||
|
||||
Plug 'kyazdani42/nvim-web-devicons' " for file icons
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
"Plug 'kyazdani42/nvim-tree.lua'
|
||||
|
||||
Plug 'ray-x/lsp_signature.nvim'
|
||||
Plug 'glepnir/lspsaga.nvim'
|
||||
" Plugins that do specific things
|
||||
"Plug 'Shougo/vimproc.vim'
|
||||
"Plug 'Shougo/vimfiler.vim'
|
||||
|
||||
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
|
||||
Plug 'kristijanhusak/defx-icons'
|
||||
|
||||
Plug 'Shougo/unite.vim'
|
||||
" TODO: Look into Coqtail, same author
|
||||
Plug 'whonore/coquille', {'branch': 'pathogen-bundle', 'for': 'coq'}
|
||||
|
|
@ -279,13 +285,17 @@ luafile $HOME/.vim/nvim.lua
|
|||
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||
nnoremap <silent> gy <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
"nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <silent> K <cmd>lua require('lspsaga.hover').render_hover_doc()<CR>
|
||||
nnoremap <silent> gK <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||
nnoremap <silent>gR <cmd>lua require('lspsaga.rename').rename()<CR>
|
||||
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
||||
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
|
||||
"nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
|
||||
nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
|
||||
"nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
|
||||
nnoremap <silent>ga <cmd>lua require('lspsaga.codeaction').code_action()<CR>
|
||||
vnoremap <silent>ga :<C-U>lua require('lspsaga.codeaction').range_code_action()<CR>
|
||||
nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR>
|
||||
|
||||
" Set updatetime for CursorHold
|
||||
|
|
@ -456,6 +466,8 @@ let g:nvim_tree_add_trailing = 1
|
|||
let g:nvim_tree_side = 'right'
|
||||
let g:nvim_tree_width = 40
|
||||
let g:nvim_tree_quit_on_open = 1
|
||||
let g:nvim_tree_disable_window_picker = 1
|
||||
let g:nvim_tree_root_folder_modifier = ':p:.'
|
||||
|
||||
" * Tagbar plugin settings
|
||||
let g:tagbar_width = 40
|
||||
|
|
@ -786,6 +798,75 @@ function InstallEverything()
|
|||
endfunction
|
||||
|
||||
command CocReinstall :CocInstall coc-json coc-pyright coc-rust-analyzer coc-snippets coc-svelte coc-tsserver coc-ultisnips
|
||||
|
||||
|
||||
autocmd FileType defx call s:defx_my_settings()
|
||||
function! s:defx_my_settings() abort
|
||||
" Define mappings
|
||||
nnoremap <silent><buffer><expr> <CR>
|
||||
\ line('.') == 1 ? defx#do_action('cd', ['..']) : defx#do_action('open')
|
||||
nnoremap <silent><buffer><expr> c
|
||||
\ defx#do_action('copy')
|
||||
nnoremap <silent><buffer><expr> m
|
||||
\ defx#do_action('move')
|
||||
nnoremap <silent><buffer><expr> p
|
||||
\ defx#do_action('paste')
|
||||
nnoremap <silent><buffer><expr> l
|
||||
\ defx#do_action('open')
|
||||
nnoremap <silent><buffer><expr> E
|
||||
\ defx#do_action('open', 'vsplit')
|
||||
nnoremap <silent><buffer><expr> P
|
||||
\ defx#do_action('preview')
|
||||
nnoremap <silent><buffer><expr> o
|
||||
\ defx#do_action('open_tree', 'toggle')
|
||||
nnoremap <silent><buffer><expr> K
|
||||
\ defx#do_action('new_directory')
|
||||
nnoremap <silent><buffer><expr> N
|
||||
\ defx#do_action('new_file')
|
||||
nnoremap <silent><buffer><expr> M
|
||||
\ defx#do_action('new_multiple_files')
|
||||
nnoremap <silent><buffer><expr> C
|
||||
\ defx#do_action('toggle_columns',
|
||||
\ 'mark:indent:icon:filename:type:size:time')
|
||||
nnoremap <silent><buffer><expr> S
|
||||
\ defx#do_action('toggle_sort', 'time')
|
||||
nnoremap <silent><buffer><expr> d
|
||||
\ defx#do_action('remove')
|
||||
nnoremap <silent><buffer><expr> r
|
||||
\ defx#do_action('rename')
|
||||
nnoremap <silent><buffer><expr> !
|
||||
\ defx#do_action('execute_command')
|
||||
nnoremap <silent><buffer><expr> x
|
||||
\ defx#do_action('execute_system')
|
||||
nnoremap <silent><buffer><expr> yy
|
||||
\ defx#do_action('yank_path')
|
||||
nnoremap <silent><buffer><expr> .
|
||||
\ defx#do_action('toggle_ignored_files')
|
||||
nnoremap <silent><buffer><expr> ;
|
||||
\ defx#do_action('repeat')
|
||||
nnoremap <silent><buffer><expr> h
|
||||
\ defx#do_action('cd', ['..'])
|
||||
nnoremap <silent><buffer><expr> ~
|
||||
\ defx#do_action('cd')
|
||||
nnoremap <silent><buffer><expr> q
|
||||
\ defx#do_action('quit')
|
||||
nnoremap <silent><buffer><expr> <Space>
|
||||
\ defx#do_action('toggle_select') . 'j'
|
||||
nnoremap <silent><buffer><expr> *
|
||||
\ defx#do_action('toggle_select_all')
|
||||
nnoremap <silent><buffer><expr> j
|
||||
\ line('.') == line('$') ? 'gg' : 'j'
|
||||
nnoremap <silent><buffer><expr> k
|
||||
\ line('.') == 1 ? 'G' : 'k'
|
||||
nnoremap <silent><buffer><expr> <C-l>
|
||||
\ defx#do_action('redraw')
|
||||
nnoremap <silent><buffer><expr> <C-g>
|
||||
\ defx#do_action('print')
|
||||
nnoremap <silent><buffer><expr> cd
|
||||
\ defx#do_action('change_vim_cwd')
|
||||
endfunction
|
||||
|
||||
|
||||
" ** KEY REMAPPINGS **
|
||||
"
|
||||
" I used to use tabs, but then I took an arrow to the knee.
|
||||
|
|
@ -799,7 +880,8 @@ command CocReinstall :CocInstall coc-json coc-pyright coc-rust-analyzer coc-snip
|
|||
"nmap gt :NERDTreeToggle<CR>
|
||||
"nmap <silent> gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide<CR>
|
||||
"nmap <silent> gt :VimFiler -status -auto-cd -parent -force-quit<CR>
|
||||
nnoremap <silent> gt :NvimTreeToggle<CR>
|
||||
nmap <silent> gt :Defx -columns=icons:indent:filename:type<CR>
|
||||
""nnoremap <silent> gt :NvimTreeToggle<CR>
|
||||
" The same for the TagList, useful for large C files.
|
||||
"nmap gb :TlistToggle<CR>
|
||||
nmap gb :TagbarToggle<CR>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue