This commit is contained in:
ksyasuda 2022-02-10 23:02:09 -08:00
parent 3d0bb88e88
commit 2582c9325b
7 changed files with 207 additions and 146 deletions

View File

@ -57,63 +57,69 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive' Plug 'ap/vim-css-color'
Plug 'tpope/vim-commentary' Plug 'github/copilot.vim'
Plug 'tpope/vim-surround' Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' 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 '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 'dense-analysis/ale'
" Plug 'neoclide/coc.nvim', {'branch': 'release'} " Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
if has('nvim') if has('nvim')
Plug 'nvim-lua/plenary.nvim'
" Plug 'TimUntersberger/neogit'
Plug 'akinsho/bufferline.nvim' Plug 'akinsho/bufferline.nvim'
" Plug 'chentau/marks.nvim' Plug 'f-person/git-blame.nvim'
Plug 'folke/which-key.nvim' Plug 'folke/which-key.nvim'
Plug 'glepnir/dashboard-nvim' Plug 'glepnir/dashboard-nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'kyazdani42/nvim-tree.lua' Plug 'kyazdani42/nvim-tree.lua'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'kyazdani42/nvim-web-devicons'
Plug 'TimUntersberger/neogit' Plug 'lewis6991/gitsigns.nvim'
Plug 'ojroques/nvim-lspfuzzy' Plug 'lewis6991/gitsigns.nvim'
Plug 'nvim-lualine/lualine.nvim' Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'ojroques/nvim-lspfuzzy'
Plug 'neovim/nvim-lspconfig' Plug 'L3MON4D3/LuaSnip'
Plug 'williamboman/nvim-lsp-installer' Plug 'folke/trouble.nvim'
Plug 'ray-x/lsp_signature.nvim'
Plug 'simrat39/symbols-outline.nvim'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/nvim-cmp' Plug 'hrsh7th/nvim-cmp'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'onsails/lspkind-nvim' Plug 'onsails/lspkind-nvim'
Plug 'saadparwaiz1/cmp_luasnip' Plug 'ray-x/lsp_signature.nvim'
Plug 'L3MON4D3/LuaSnip'
Plug 'rmagatti/goto-preview', 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 'Mofiqul/dracula.nvim'
Plug 'NTBBloodbath/doom-one.nvim'
Plug 'olimorris/onedarkpro.nvim'
Plug 'projekt0n/github-nvim-theme' Plug 'projekt0n/github-nvim-theme'
else else
Plug 'ap/vim-buftabline' 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 'mhinz/vim-startify'
Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } Plug 'ryanoasis/vim-devicons'
Plug 'itchyny/lightline.vim' Plug 'sheerun/vim-polyglot'
Plug 'maximbaz/lightline-ale' Plug 'tpope/vim-fugitive'
Plug 'joshdick/onedark.vim' Plug 'joshdick/onedark.vim'
Plug 'kaicataldo/material.vim', { 'branch': 'main' } Plug 'kaicataldo/material.vim', { 'branch': 'main' }
@ -124,33 +130,36 @@ endif
call plug#end() call plug#end()
if has('nvim') 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/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/dashboard-art.vim
source ~/.config/nvim/plugin-confs/nvimtree.lua source ~/.config/nvim/plugin-confs/dashboard-nvim.lua
source ~/.config/nvim/plugin-confs/treesitter.lua source ~/.config/nvim/plugin-confs/git-blame.lua
source ~/.config/nvim/plugin-confs/neogit.lua source ~/.config/nvim/plugin-confs/gitsigns.lua
source ~/.config/nvim/plugin-confs/lspfuzzy.lua source ~/.config/nvim/plugin-confs/lspfuzzy.lua
source ~/.config/nvim/plugin-confs/lualine.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/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/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/null-ls.lua
source ~/.config/nvim/plugin-confs/nvim-cmp.lua source ~/.config/nvim/plugin-confs/nvim-cmp.lua
source ~/.config/nvim/plugin-confs/lsp-kind.lua source ~/.config/nvim/plugin-confs/symbols-outline.lua
source ~/.config/nvim/plugin-confs/goto-preview.lua
source ~/.config/nvim/plugin-confs/trouble.lua source ~/.config/nvim/plugin-confs/trouble.lua
source ~/.vim/plugin-confs/floaterm.vim
source ~/.vim/plugin-confs/fzf.vim source ~/.vim/plugin-confs/fzf.vim
source ~/.vim/plugin-confs/lightline.vim
source ~/.vim/plugin-confs/vim-closetag.vim source ~/.vim/plugin-confs/vim-closetag.vim
source ~/.vim/plugin-confs/wakatime.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/doomone.lua
source ~/.config/nvim/plugin-confs/dracula.lua source ~/.config/nvim/plugin-confs/dracula.lua
@ -170,6 +179,8 @@ if has('nvim')
autocmd TermOpen * setlocal nonumber norelativenumber autocmd TermOpen * setlocal nonumber norelativenumber
else else
source ~/.vim/keybindings.vim
source ~/.vim/plugin-confs/nerdtree.vim source ~/.vim/plugin-confs/nerdtree.vim
source ~/.vim/plugin-confs/whichkey.vim source ~/.vim/plugin-confs/whichkey.vim
source ~/.vim/plugin-confs/ale.vim source ~/.vim/plugin-confs/ale.vim
@ -231,13 +242,16 @@ endif
"------------------------------------------------------------------------------ "------------------------------------------------------------------------------
" custom commands " 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 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 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! Reload execute "source ~/.vimrc"
command! Config execute ":e ~/.vimrc" command! Config execute ":e ~/.vimrc"
@ -245,13 +259,3 @@ command! Env execute ":Dotenv .env"
command! MakeTags !ctags -R . command! MakeTags !ctags -R .
command! Ovewrite execute ":w !sudo tee %" command! Ovewrite execute ":w !sudo tee %"
command! Aniwrapper execute ":FloatermNew aniwrapper -qtdoomone -D 144" 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

View File

@ -1,97 +1,106 @@
" KEYBINDINGS
" imap <TAB> <C-N>
nmap <F4> :set paste!<Bar>set paste?<CR> nmap <F4> :set paste!<Bar>set paste?<CR>
nmap <F5> :! 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 " reselect visual selection after indent
vnoremap < <gv vnoremap < <gv
vnoremap > >gv vnoremap > >gv
" open file under cursor, create if necessary " for toggling/hiding the vsplit-term
nnoremap gF :edit <cfile><cr> 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 // :Lines<CR>
nnoremap ?? :BLines<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>as :FloatermNew --title=aniwrapper aniwrapper -qtdoomone -D144<CR>
nmap <leader>ad :FloatermNew --title=aniwrapper ani-cli -q720p -cd/home/sudacode/Videos/sauce -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>bb :Buffers<CR>
nmap <leader>bk :bdelete<CR> nmap <leader>bk :bdelete<CR>
nmap <leader>bn :bnext<CR> nmap <leader>bn :bnext<CR>
nmap <leader>bp :bprev<CR> nmap <leader>bp :bprev<CR>
nmap <C-J> :bnext<CR>
nmap <C-K> :bprev<CR>
nmap <leader>cd :LspDiagnostics <bufnr><CR> nmap <leader>cd :LspDiagnostics <bufnr><CR>
" git nnoremap <silent> <Leader>cn :DashboardNewFile<CR>
nmap <leader>gc :CocCommand fzf-preview.GitLogs<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> nmap <leader>gf :GitFiles<CR>
if has('nvim') " nmap <leader>gg :Neogit<CR>
nmap <leader>gg :Neogit<CR> nmap <leader>gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>
else nnoremap gP <cmd>lua require('goto-preview').close_all_win()<CR>
nmap <leader>gg :FloatermNew --title=lazygit --opener=vsplit --width=1.0 --height=1.0 lazygit<CR> nnoremap gR <cmd>TroubleToggle lsp_references<cr>
endif
" nmap <leader>gs :CocCommand fzf-preview.GitStatus<CR>
" nmap gr :<C-u>CocCommand fzf-preview.CocReferences<CR>
nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR> nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR>
nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR> nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR>
nnoremap gpi <cmd>lua require('goto-preview').goto_preview_implementation()<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>hc :Commands<CR>
nmap <leader>hh :Helptags<CR>
nmap <leader>hk :Maps<CR> nmap <leader>hk :Maps<CR>
" insert snippets
nmap <leader>isp :-1read $HOME/Templates/python.py<CR>4jw nmap <leader>isp :-1read $HOME/Templates/python.py<CR>4jw
" any jump plugin
nmap <leader>j :AnyJump<CR> nmap <leader>j :AnyJump<CR>
nmap K :lua vim.lsp.buf.hover()<CR>
nmap <leader>n :NvimTreeToggle<CR> nmap <leader>n :NvimTreeToggle<CR>
" toggle/open
nmap <leader>ob :FloatermNew --title=bpytop --opener=vsplit bpytop<CR> nmap <leader>ob :FloatermNew --title=bpytop --opener=vsplit bpytop<CR>
nmap <leader>od :FloatermNew --title=lazydocker --opener=vsplit lazydocker<CR> nmap <leader>od :FloatermNew --title=lazydocker --opener=vsplit lazydocker<CR>
nmap <leader>on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp<CR> nmap <leader>on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp<CR>
nmap <leader>oo :OverCommandLine<CR> nmap <leader>oo :OverCommandLine<CR>
nmap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<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> 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> 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>sc :nohls<Cr>
nmap <leader>sf :Files<Cr> nmap <leader>sf :Files<Cr>
nmap <leader>sF :AllFiles<Cr> nmap <leader>sh :History:<CR>
" toggle coc outline nmap <leader>s/ :History/<CR>
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>
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>tc :DashboardChangeColorscheme<CR>
nnoremap <silent> <Leader>fa :DashboardFindWord<CR> nmap <leader>to :SymbolsOutline<CR>
nnoremap <silent> <Leader>fb :DashboardJumpMark<CR> nmap <leader>tt :FloatermToggle vsplit-term<CR>
nnoremap <silent> <Leader>cn :DashboardNewFile<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>

View File

@ -0,0 +1,2 @@
vim.g.gitblame_highlight_group = "Question"
vim.g.gitblame_enabled = 0

View 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
},
}

View File

@ -1,10 +1,10 @@
require('goto-preview').setup { require('goto-preview').setup {
width = 120; -- Width of the floating window 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 border = {"", "" ,"", "", "", "", "", ""}; -- Border characters of the floating window
default_mappings = false; -- Bind default mappings default_mappings = false; -- Bind default mappings
debug = false; -- Print debug information 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. 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. 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. 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. -- 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. focus_on_open = true; -- Focus the floating window when opening it.
dismiss_on_move = false; -- Dismiss the floating window when moving the cursor. 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 bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden
} }

View File

@ -12,31 +12,33 @@ local on_attach = function(client, bufnr)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- 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) -- set in ~/.config/nvim/keybindings.vim
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', 'gD', '<cmd>lua vim.lsp.buf.declaration()<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', 'gd', '<cmd>lua vim.lsp.buf.definition()<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', 'K', '<cmd>lua vim.lsp.buf.hover()<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', 'gi', '<cmd>lua vim.lsp.buf.implementation()<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', '<C-s>', '<cmd>lua vim.lsp.buf.signature_help()<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>wa', '<cmd>lua vim.lsp.buf.add_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>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<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>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<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>D', '<cmd>lua vim.lsp.buf.type_definition()<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', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<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>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) -- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
if client.resolved_capabilities.document_highlight then -- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
vim.cmd [[ -- highlighting things under cursor
hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow -- if client.resolved_capabilities.document_highlight then
hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow -- vim.cmd [[
hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow -- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
augroup lsp_document_highlight -- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
autocmd! * <buffer> -- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight() -- augroup lsp_document_highlight
autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references() -- autocmd! * <buffer>
augroup END -- autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
]] -- autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
end -- augroup END
-- ]]
-- end
end end
vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]] vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]
@ -109,7 +111,7 @@ vim.diagnostic.config({
signs = true, signs = true,
underline = true, underline = true,
update_in_insert = false, update_in_insert = false,
severity_sort = false, severity_sort = true,
}) })
local signs = { Error = "", Warn = "", Hint = "", Info = "" } local signs = { Error = "", Warn = "", Hint = "", Info = "" }

View File

@ -14,6 +14,7 @@ require("null-ls").setup({
end, end,
sources = { sources = {
require("null-ls").builtins.completion.spell, require("null-ls").builtins.completion.spell,
require("null-ls").builtins.code_actions.gitsigns,
require("null-ls").builtins.formatting.shfmt.with({ require("null-ls").builtins.formatting.shfmt.with({
filetypes = {"sh", "bash"}, filetypes = {"sh", "bash"},
extra_args = { "-i", "4", "-ci", "-sr" } extra_args = { "-i", "4", "-ci", "-sr" }