mirror of
https://github.com/ksyasuda/rice.git
synced 2024-11-22 03:19:58 -08:00
updates
This commit is contained in:
parent
3d0bb88e88
commit
2582c9325b
120
nvim/init.vim
120
nvim/init.vim
@ -57,63 +57,69 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'ap/vim-css-color'
|
||||
Plug 'github/copilot.vim'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'wakatime/vim-wakatime'
|
||||
Plug 'voldikss/vim-floaterm'
|
||||
Plug 'pechorin/any-jump.vim'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'ap/vim-css-color'
|
||||
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
Plug 'osyo-manga/vim-over'
|
||||
Plug 'github/copilot.vim'
|
||||
Plug 'pechorin/any-jump.vim'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'voldikss/vim-floaterm'
|
||||
Plug 'wakatime/vim-wakatime'
|
||||
|
||||
" Plug 'dense-analysis/ale'
|
||||
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
|
||||
let g:mapleader = "\<Space>"
|
||||
let g:maplocalleader = ','
|
||||
|
||||
if has('nvim')
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
|
||||
" Plug 'TimUntersberger/neogit'
|
||||
Plug 'akinsho/bufferline.nvim'
|
||||
" Plug 'chentau/marks.nvim'
|
||||
Plug 'f-person/git-blame.nvim'
|
||||
Plug 'folke/which-key.nvim'
|
||||
Plug 'glepnir/dashboard-nvim'
|
||||
Plug 'kyazdani42/nvim-web-devicons'
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
Plug 'TimUntersberger/neogit'
|
||||
Plug 'ojroques/nvim-lspfuzzy'
|
||||
Plug 'kyazdani42/nvim-web-devicons'
|
||||
Plug 'lewis6991/gitsigns.nvim'
|
||||
Plug 'lewis6991/gitsigns.nvim'
|
||||
Plug 'nvim-lualine/lualine.nvim'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
Plug 'ojroques/nvim-lspfuzzy'
|
||||
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'williamboman/nvim-lsp-installer'
|
||||
Plug 'ray-x/lsp_signature.nvim'
|
||||
Plug 'simrat39/symbols-outline.nvim'
|
||||
Plug 'jose-elias-alvarez/null-ls.nvim'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'L3MON4D3/LuaSnip'
|
||||
Plug 'folke/trouble.nvim'
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-path'
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
Plug 'jose-elias-alvarez/null-ls.nvim'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'onsails/lspkind-nvim'
|
||||
Plug 'saadparwaiz1/cmp_luasnip'
|
||||
Plug 'L3MON4D3/LuaSnip'
|
||||
Plug 'ray-x/lsp_signature.nvim'
|
||||
Plug 'rmagatti/goto-preview',
|
||||
Plug 'folke/trouble.nvim'
|
||||
Plug 'saadparwaiz1/cmp_luasnip'
|
||||
Plug 'simrat39/symbols-outline.nvim'
|
||||
Plug 'williamboman/nvim-lsp-installer'
|
||||
|
||||
Plug 'olimorris/onedarkpro.nvim'
|
||||
Plug 'NTBBloodbath/doom-one.nvim'
|
||||
Plug 'Mofiqul/dracula.nvim'
|
||||
Plug 'NTBBloodbath/doom-one.nvim'
|
||||
Plug 'olimorris/onedarkpro.nvim'
|
||||
Plug 'projekt0n/github-nvim-theme'
|
||||
else
|
||||
Plug 'ap/vim-buftabline'
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
|
||||
Plug 'maximbaz/lightline-ale'
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
|
||||
Plug 'itchyny/lightline.vim'
|
||||
Plug 'maximbaz/lightline-ale'
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
|
||||
Plug 'joshdick/onedark.vim'
|
||||
Plug 'kaicataldo/material.vim', { 'branch': 'main' }
|
||||
@ -124,33 +130,36 @@ endif
|
||||
call plug#end()
|
||||
|
||||
if has('nvim')
|
||||
set completeopt=menu,menuone,noselect
|
||||
source ~/.config/nvim/keybindings.vim
|
||||
|
||||
source ~/.config/nvim/plugin-confs/bufferline.lua
|
||||
" source ~/.config/nvim/plugin-confs/marks.lua
|
||||
source ~/.config/nvim/plugin-confs/whichkey.lua
|
||||
source ~/.config/nvim/plugin-confs/dashboard-nvim.lua
|
||||
source ~/.config/nvim/plugin-confs/dashboard-art.vim
|
||||
source ~/.config/nvim/plugin-confs/nvimtree.lua
|
||||
source ~/.config/nvim/plugin-confs/treesitter.lua
|
||||
source ~/.config/nvim/plugin-confs/neogit.lua
|
||||
source ~/.config/nvim/plugin-confs/dashboard-nvim.lua
|
||||
source ~/.config/nvim/plugin-confs/git-blame.lua
|
||||
source ~/.config/nvim/plugin-confs/gitsigns.lua
|
||||
source ~/.config/nvim/plugin-confs/lspfuzzy.lua
|
||||
source ~/.config/nvim/plugin-confs/lualine.lua
|
||||
" source ~/.config/nvim/plugin-confs/neogit.lua
|
||||
source ~/.config/nvim/plugin-confs/nvimtree.lua
|
||||
source ~/.config/nvim/plugin-confs/treesitter.lua
|
||||
source ~/.config/nvim/plugin-confs/whichkey.lua
|
||||
|
||||
set completeopt=menu,menuone,noselect
|
||||
source ~/.config/nvim/plugin-confs/code_actions.lua
|
||||
source ~/.config/nvim/plugin-confs/lspconfig.lua
|
||||
source ~/.config/nvim/plugin-confs/goto-preview.lua
|
||||
source ~/.config/nvim/plugin-confs/lsp-kind.lua
|
||||
source ~/.config/nvim/plugin-confs/lsp-signature.lua
|
||||
source ~/.config/nvim/plugin-confs/symbols-outline.lua
|
||||
source ~/.config/nvim/plugin-confs/lspconfig.lua
|
||||
source ~/.config/nvim/plugin-confs/null-ls.lua
|
||||
source ~/.config/nvim/plugin-confs/nvim-cmp.lua
|
||||
source ~/.config/nvim/plugin-confs/lsp-kind.lua
|
||||
source ~/.config/nvim/plugin-confs/goto-preview.lua
|
||||
source ~/.config/nvim/plugin-confs/symbols-outline.lua
|
||||
source ~/.config/nvim/plugin-confs/trouble.lua
|
||||
|
||||
source ~/.vim/plugin-confs/floaterm.vim
|
||||
source ~/.vim/plugin-confs/fzf.vim
|
||||
source ~/.vim/plugin-confs/lightline.vim
|
||||
source ~/.vim/plugin-confs/vim-closetag.vim
|
||||
source ~/.vim/plugin-confs/wakatime.vim
|
||||
source ~/.vim/plugin-confs/lightline.vim
|
||||
source ~/.vim/plugin-confs/floaterm.vim
|
||||
|
||||
source ~/.config/nvim/plugin-confs/doomone.lua
|
||||
source ~/.config/nvim/plugin-confs/dracula.lua
|
||||
@ -170,6 +179,8 @@ if has('nvim')
|
||||
autocmd TermOpen * setlocal nonumber norelativenumber
|
||||
|
||||
else
|
||||
source ~/.vim/keybindings.vim
|
||||
|
||||
source ~/.vim/plugin-confs/nerdtree.vim
|
||||
source ~/.vim/plugin-confs/whichkey.vim
|
||||
source ~/.vim/plugin-confs/ale.vim
|
||||
@ -231,13 +242,16 @@ endif
|
||||
"------------------------------------------------------------------------------
|
||||
" custom commands
|
||||
"------------------------------------------------------------------------------
|
||||
" command! -bang -nargs=? -complete=dir Files
|
||||
" \ call fzf#run(fzf#wrap('files', fzf#vim#with_preview({'dir': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden'}), <bang>0))
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0)
|
||||
|
||||
command! -bang -nargs=? -complete=dir AllFiles
|
||||
\ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden --no-ignore'}), <bang>0))
|
||||
\ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({'dir': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden --no-ignore', 'options': ['--layout=reverse', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0))
|
||||
|
||||
command! Lines call fzf#vim#lines(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse']}), <bang>0)
|
||||
|
||||
command! -bang -nargs=? -complete=dir Buffers
|
||||
\ call fzf#vim#buffers(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh']}), <bang>0)
|
||||
|
||||
command! Reload execute "source ~/.vimrc"
|
||||
command! Config execute ":e ~/.vimrc"
|
||||
@ -245,13 +259,3 @@ command! Env execute ":Dotenv .env"
|
||||
command! MakeTags !ctags -R .
|
||||
command! Ovewrite execute ":w !sudo tee %"
|
||||
command! Aniwrapper execute ":FloatermNew aniwrapper -qtdoomone -D 144"
|
||||
"------------------------------------------------------------------------------
|
||||
"KEYBINDINGS
|
||||
"------------------------------------------------------------------------------
|
||||
let g:mapleader = "\<Space>"
|
||||
let g:maplocalleader = ','
|
||||
if has('nvim')
|
||||
source ~/.config/nvim/keybindings.vim
|
||||
else
|
||||
source ~/.vim/keybindings.vim
|
||||
endif
|
||||
|
@ -1,97 +1,106 @@
|
||||
" KEYBINDINGS
|
||||
" imap <TAB> <C-N>
|
||||
nmap <F4> :set paste!<Bar>set paste?<CR>
|
||||
nmap <F5> :!
|
||||
" nmap <C-n> :NERDTreeToggle<CR>
|
||||
nmap <C-n> :NvimTreeToggle<CR>
|
||||
" nnoremap <C-T> :wa<CR>:vertical botright term ++kill=term<CR>
|
||||
nmap Q !!$SHELL<CR>
|
||||
|
||||
" reselect visual selection after indent
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" open file under cursor, create if necessary
|
||||
nnoremap gF :edit <cfile><cr>
|
||||
" for toggling/hiding the vsplit-term
|
||||
tnoremap <C-T> <C-\><C-n>:FloatermToggle floatingterm<CR>
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
tnoremap <leader>tt <C-\><C-N>:FloatermToggle vsplit-term<CR>
|
||||
|
||||
" fzf
|
||||
nmap <C-J> :bnext<CR>
|
||||
nmap <C-K> :bprev<CR>
|
||||
nmap <C-T> :wa<CR>:FloatermToggle floatingterm<CR>
|
||||
nmap <C-n> :NvimTreeToggle<CR>
|
||||
|
||||
" open file under cursor, create if necessary
|
||||
nnoremap // :Lines<CR>
|
||||
nnoremap ?? :BLines<CR>
|
||||
|
||||
" aniwrapper/ani-cli (until i find better use for a keys)
|
||||
nmap ca :lua vim.lsp.buf.code_action()<CR>
|
||||
|
||||
nmap gD :lua vim.lsp.buf.declaration()<CR>
|
||||
nmap gF :edit <cfile><cr>
|
||||
nmap gT :lua vim.lsp.buf.type_definition()<CR>
|
||||
nmap gb :lua vim.lsp.buf.document_symbol()<CR>
|
||||
nmap gd :lua vim.lsp.buf.definition()<CR>
|
||||
nmap gi :lua vim.lsp.buf.implementation()<CR>
|
||||
nmap gl :lua vim.lsp.buf.code_lens()<CR>
|
||||
nmap gr :lua vim.lsp.buf.references()<CR>
|
||||
nmap gs :lua vim.lsp.buf.signature_help()<CR>
|
||||
|
||||
nmap Q !!$SHELL<CR>
|
||||
|
||||
nmap rn :lua vim.lsp.buf.rename()<CR>
|
||||
|
||||
nmap wa :lua vim.lsp.buf.add_workspace_folder()<CR>
|
||||
nmap wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>
|
||||
nmap wr :lua vim.lsp.buf.remove_workspace_folder()<CR>
|
||||
|
||||
nmap <leader>as :FloatermNew --title=aniwrapper aniwrapper -qtdoomone -D144<CR>
|
||||
nmap <leader>ad :FloatermNew --title=aniwrapper ani-cli -q720p -cd/home/sudacode/Videos/sauce -D144<CR>
|
||||
" buffers
|
||||
" nmap <leader>bB :CocCommand fzf-preview.AllBuffers<CR>
|
||||
|
||||
nmap <leader>bb :Buffers<CR>
|
||||
nmap <leader>bk :bdelete<CR>
|
||||
nmap <leader>bn :bnext<CR>
|
||||
nmap <leader>bp :bprev<CR>
|
||||
nmap <C-J> :bnext<CR>
|
||||
nmap <C-K> :bprev<CR>
|
||||
|
||||
nmap <leader>cd :LspDiagnostics <bufnr><CR>
|
||||
" git
|
||||
nmap <leader>gc :CocCommand fzf-preview.GitLogs<CR>
|
||||
nnoremap <silent> <Leader>cn :DashboardNewFile<CR>
|
||||
|
||||
nmap <leader>ff :CocCommand fzf-preview.ProjectFiles<CR>
|
||||
nmap <silent> <Leader>fa :DashboardFindWord<CR>
|
||||
nmap <silent> <Leader>fb :DashboardJumpMark<CR>
|
||||
nmap <silent> <Leader>fh :DashboardFindHistory<CR>
|
||||
|
||||
nmap <leader>gb :GitBlameToggle<CR>
|
||||
nmap <leader>gc :Commits<CR>
|
||||
nmap <leader>gf :GitFiles<CR>
|
||||
if has('nvim')
|
||||
nmap <leader>gg :Neogit<CR>
|
||||
else
|
||||
nmap <leader>gg :FloatermNew --title=lazygit --opener=vsplit --width=1.0 --height=1.0 lazygit<CR>
|
||||
endif
|
||||
" nmap <leader>gs :CocCommand fzf-preview.GitStatus<CR>
|
||||
" nmap gr :<C-u>CocCommand fzf-preview.CocReferences<CR>
|
||||
" nmap <leader>gg :Neogit<CR>
|
||||
nmap <leader>gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>
|
||||
nnoremap gP <cmd>lua require('goto-preview').close_all_win()<CR>
|
||||
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
|
||||
nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR>
|
||||
nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR>
|
||||
nnoremap gpi <cmd>lua require('goto-preview').goto_preview_implementation()<CR>
|
||||
nnoremap gP <cmd>lua require('goto-preview').close_all_win()<CR>
|
||||
nnoremap gR <cmd>TroubleToggle lsp_references<cr>
|
||||
" Only set if you have telescope installed
|
||||
" nnoremap gpr <cmd>lua require('goto-preview').goto_preview_references()<CR>
|
||||
" help/history
|
||||
|
||||
nmap <leader>hc :Commands<CR>
|
||||
nmap <leader>hh :Helptags<CR>
|
||||
nmap <leader>hk :Maps<CR>
|
||||
" insert snippets
|
||||
|
||||
nmap <leader>isp :-1read $HOME/Templates/python.py<CR>4jw
|
||||
" any jump plugin
|
||||
|
||||
nmap <leader>j :AnyJump<CR>
|
||||
|
||||
nmap K :lua vim.lsp.buf.hover()<CR>
|
||||
|
||||
nmap <leader>n :NvimTreeToggle<CR>
|
||||
" toggle/open
|
||||
|
||||
nmap <leader>ob :FloatermNew --title=bpytop --opener=vsplit bpytop<CR>
|
||||
nmap <leader>od :FloatermNew --title=lazydocker --opener=vsplit lazydocker<CR>
|
||||
nmap <leader>on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp<CR>
|
||||
nmap <leader>oo :OverCommandLine<CR>
|
||||
nmap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<CR>
|
||||
" nmap <leader>ot :vertical botright ter ++kill=terminal ++close<CR>
|
||||
nmap <leader>ot :FloatermNew --title=floaterm --name=vsplit-term --wintype=vsplit --position=botright --width=0.5<CR>
|
||||
" refresh nvimtree for now
|
||||
|
||||
nmap <leader>r :NvimTreeRefresh<CR>
|
||||
" search
|
||||
|
||||
nmap <Leader>sl :<C-u>SessionLoad<CR>
|
||||
nmap <Leader>ss :<C-u>SessionSave<CR>
|
||||
nmap <leader>sF :AllFiles<Cr>
|
||||
nmap <leader>sc :nohls<Cr>
|
||||
nmap <leader>sf :Files<Cr>
|
||||
nmap <leader>sF :AllFiles<Cr>
|
||||
" toggle coc outline
|
||||
nmap <leader>to :SymbolsOutline<CR>
|
||||
" terminal
|
||||
nmap <leader>tt :FloatermToggle vsplit-term<CR>
|
||||
nmap <C-T> :wa<CR>:FloatermToggle floatingterm<CR>
|
||||
" for toggling/hiding the vsplit-term
|
||||
tnoremap <leader>tt <C-\><C-N>:FloatermToggle vsplit-term<CR>
|
||||
tnoremap <C-T> <C-\><C-n>:FloatermToggle floatingterm<CR>
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
nmap <leader>sh :History:<CR>
|
||||
nmap <leader>s/ :History/<CR>
|
||||
|
||||
nnoremap <leader>xx <cmd>TroubleToggle<cr>
|
||||
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
||||
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
|
||||
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
||||
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
|
||||
|
||||
nmap <Leader>ss :<C-u>SessionSave<CR>
|
||||
nmap <Leader>sl :<C-u>SessionLoad<CR>
|
||||
nnoremap <silent> <Leader>fh :DashboardFindHistory<CR>
|
||||
" search fzf, refs, impls, defs
|
||||
nmap <leader>ff :CocCommand fzf-preview.ProjectFiles<CR>
|
||||
" nnoremap <silent> <Leader>ff :DashboardFindFile<CR>
|
||||
nnoremap <silent> <Leader>tc :DashboardChangeColorscheme<CR>
|
||||
nnoremap <silent> <Leader>fa :DashboardFindWord<CR>
|
||||
nnoremap <silent> <Leader>fb :DashboardJumpMark<CR>
|
||||
nnoremap <silent> <Leader>cn :DashboardNewFile<CR>
|
||||
nmap <leader>to :SymbolsOutline<CR>
|
||||
nmap <leader>tt :FloatermToggle vsplit-term<CR>
|
||||
|
||||
nnoremap <leader>xd <cmd>TroubleToggle document_diagnostics<cr>
|
||||
nnoremap <leader>xl <cmd>TroubleToggle loclist<cr>
|
||||
nnoremap <leader>xq <cmd>TroubleToggle quickfix<cr>
|
||||
nnoremap <leader>xw <cmd>TroubleToggle workspace_diagnostics<cr>
|
||||
nnoremap <leader>xx <cmd>TroubleToggle<cr>
|
||||
|
2
nvim/plugin-confs/git-blame.lua
Normal file
2
nvim/plugin-confs/git-blame.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.g.gitblame_highlight_group = "Question"
|
||||
vim.g.gitblame_enabled = 0
|
43
nvim/plugin-confs/gitsigns.lua
Normal file
43
nvim/plugin-confs/gitsigns.lua
Normal file
@ -0,0 +1,43 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
||||
change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
require('goto-preview').setup {
|
||||
width = 120; -- Width of the floating window
|
||||
height = 15; -- Height of the floating window
|
||||
height = 20; -- Height of the floating window
|
||||
border = {"↖", "─" ,"┐", "│", "┘", "─", "└", "│"}; -- Border characters of the floating window
|
||||
default_mappings = false; -- Bind default mappings
|
||||
debug = false; -- Print debug information
|
||||
opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent.
|
||||
opacity = 25; -- 0-100 opacity level of the floating window where 100 is fully transparent.
|
||||
resizing_mappings = false; -- Binds arrow keys to resizing the floating window.
|
||||
post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook.
|
||||
references = { -- Configure the telescope UI for slowing the references cycling window.
|
||||
@ -13,6 +13,6 @@ require('goto-preview').setup {
|
||||
-- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality.
|
||||
focus_on_open = true; -- Focus the floating window when opening it.
|
||||
dismiss_on_move = false; -- Dismiss the floating window when moving the cursor.
|
||||
force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
||||
force_close = false, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
||||
bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden
|
||||
}
|
||||
|
@ -12,31 +12,33 @@ local on_attach = function(client, bufnr)
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
if client.resolved_capabilities.document_highlight then
|
||||
vim.cmd [[
|
||||
hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
||||
hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
||||
hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
||||
augroup lsp_document_highlight
|
||||
autocmd! * <buffer>
|
||||
autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
augroup END
|
||||
]]
|
||||
end
|
||||
-- set in ~/.config/nvim/keybindings.vim
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-s>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
-- highlighting things under cursor
|
||||
-- if client.resolved_capabilities.document_highlight then
|
||||
-- vim.cmd [[
|
||||
-- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- augroup lsp_document_highlight
|
||||
-- autocmd! * <buffer>
|
||||
-- autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
-- autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
-- augroup END
|
||||
-- ]]
|
||||
-- end
|
||||
end
|
||||
|
||||
vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]
|
||||
@ -109,7 +111,7 @@ vim.diagnostic.config({
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
|
@ -14,6 +14,7 @@ require("null-ls").setup({
|
||||
end,
|
||||
sources = {
|
||||
require("null-ls").builtins.completion.spell,
|
||||
require("null-ls").builtins.code_actions.gitsigns,
|
||||
require("null-ls").builtins.formatting.shfmt.with({
|
||||
filetypes = {"sh", "bash"},
|
||||
extra_args = { "-i", "4", "-ci", "-sr" }
|
||||
|
Loading…
Reference in New Issue
Block a user