neovim vimscript confs
This commit is contained in:
parent
362352b6f4
commit
70d9e12380
17 changed files with 6396 additions and 0 deletions
2788
neovim_vimscriptonly/nvim/autoload/plug.vim
Normal file
2788
neovim_vimscriptonly/nvim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load diff
2786
neovim_vimscriptonly/nvim/autoload/plug.vim.old
Normal file
2786
neovim_vimscriptonly/nvim/autoload/plug.vim.old
Normal file
File diff suppressed because it is too large
Load diff
18
neovim_vimscriptonly/nvim/autoload/vim-plug/plugins.vim
Normal file
18
neovim_vimscriptonly/nvim/autoload/vim-plug/plugins.vim
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
" auto-install vim-plug
|
||||||
|
if empty(glob('~/.config/nvim/autoload/plug.vim'))
|
||||||
|
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
|
||||||
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
"autocmd VimEnter * PlugInstall
|
||||||
|
"autocmd VimEnter * PlugInstall | source $MYVIMRC
|
||||||
|
endif
|
||||||
|
|
||||||
|
call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
|
|
||||||
|
" Better Syntax Support
|
||||||
|
Plug 'sheerun/vim-polyglot'
|
||||||
|
" File Explorer
|
||||||
|
Plug 'scrooloose/NERDTree'
|
||||||
|
" Auto pairs for '(' '[' '{'
|
||||||
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
|
||||||
|
call plug#end()
|
25
neovim_vimscriptonly/nvim/coc-settings.json
Normal file
25
neovim_vimscriptonly/nvim/coc-settings.json
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"languageserver": {
|
||||||
|
"ccls": {
|
||||||
|
"command": "ccls",
|
||||||
|
"filetypes": ["c", "cpp", "objc", "objcpp"],
|
||||||
|
"rootPatterns": [
|
||||||
|
".ccls",
|
||||||
|
"compile_commands.json",
|
||||||
|
".vim/",
|
||||||
|
".git/",
|
||||||
|
".hg/"
|
||||||
|
],
|
||||||
|
"initializationOptions": {
|
||||||
|
"cache": {
|
||||||
|
"directory": "/tmp/ccls"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"coc.preferences.diagnostic.virtualText": true,
|
||||||
|
"clangd.path": "/home/sid/.config/coc/extensions/coc-clangd-data/install/11.0.0/clangd_11.0.0/bin/clangd"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
113
neovim_vimscriptonly/nvim/confs/coc.vim
Normal file
113
neovim_vimscriptonly/nvim/confs/coc.vim
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
" Use tab for trigger completion with characters ahead and navigate.
|
||||||
|
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ pumvisible() ? "\<C-n>" :
|
||||||
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||||
|
|
||||||
|
function! s:check_back_space() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Use <c-space> to trigger completion.
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
|
||||||
|
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||||
|
" Coc only does snippet and additional edit on confirm.
|
||||||
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
|
|
||||||
|
" Use `[c` and `]c` to navigate diagnostics
|
||||||
|
nmap <silent> [c <Plug>(coc-diagnostic-prev)
|
||||||
|
nmap <silent> ]c <Plug>(coc-diagnostic-next)
|
||||||
|
|
||||||
|
" Remap keys for gotos
|
||||||
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
|
|
||||||
|
" Use K to show documentation in preview window
|
||||||
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
|
|
||||||
|
function! s:show_documentation()
|
||||||
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
|
execute 'h '.expand('<cword>')
|
||||||
|
else
|
||||||
|
call CocAction('doHover')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Highlight symbol under cursor on CursorHold
|
||||||
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
|
|
||||||
|
" Remap for rename current word
|
||||||
|
nmap <leader>rn <Plug>(coc-rename)
|
||||||
|
|
||||||
|
" Remap for format selected region
|
||||||
|
xmap <leader>f <Plug>(coc-format-selected)
|
||||||
|
nmap <leader>f <Plug>(coc-format-selected)
|
||||||
|
|
||||||
|
augroup mygroup
|
||||||
|
autocmd!
|
||||||
|
" Setup formatexpr specified filetype(s).
|
||||||
|
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
||||||
|
" Update signature help on jump placeholder
|
||||||
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
|
||||||
|
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||||
|
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||||
|
|
||||||
|
" Remap for do codeAction of current line
|
||||||
|
nmap <leader>ac <Plug>(coc-codeaction)
|
||||||
|
" Fix autofix problem of current line
|
||||||
|
nmap <leader>qf <Plug>(coc-fix-current)
|
||||||
|
|
||||||
|
" Use <tab> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||||||
|
nmap <silent> <TAB> <Plug>(coc-range-select)
|
||||||
|
xmap <silent> <TAB> <Plug>(coc-range-select)
|
||||||
|
xmap <silent> <S-TAB> <Plug>(coc-range-select-backword)
|
||||||
|
|
||||||
|
" Use `:Format` to format current buffer
|
||||||
|
command! -nargs=0 Format :call CocAction('format')
|
||||||
|
|
||||||
|
" Use `:Fold` to fold current buffer
|
||||||
|
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||||
|
|
||||||
|
" use `:OR` for organize import of current buffer
|
||||||
|
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||||||
|
|
||||||
|
" Add status line support, for integration with other plugin, checkout `:h coc-status`
|
||||||
|
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
||||||
|
|
||||||
|
" Using CocList
|
||||||
|
" Show all diagnostics
|
||||||
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||||
|
" Manage extensions
|
||||||
|
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||||
|
" Show commands
|
||||||
|
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||||
|
" Find symbol of current document
|
||||||
|
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||||
|
" Search workspace symbols
|
||||||
|
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||||
|
" Do default action for next item.
|
||||||
|
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||||
|
" Do default action for previous item.
|
||||||
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||||
|
" Resume latest coc list
|
||||||
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||||
|
|
||||||
|
set clipboard+=unnamedplus
|
||||||
|
|
||||||
|
function! GetHighlightGroup()
|
||||||
|
let l:s = synID(line('.'), col('.'), 1)
|
||||||
|
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap gA :call GetHighlightGroup()<CR>
|
||||||
|
|
||||||
|
set fillchars=eob:\
|
19
neovim_vimscriptonly/nvim/confs/cpp.vim
Normal file
19
neovim_vimscriptonly/nvim/confs/cpp.vim
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
let g:AutoPairsFlyMode = 1
|
||||||
|
let g:rainbow_active = 1
|
||||||
|
let g:cpp_class_scope_highlight = 1
|
||||||
|
let g:cpp_member_variable_highlight = 1
|
||||||
|
let g:cpp_class_decl_highlight = 1
|
||||||
|
let g:cpp_posix_standard = 1
|
||||||
|
let g:cpp_experimental_template_highlight = 1
|
||||||
|
let g:cpp_no_function_highlight = 1
|
||||||
|
let g:cpp_no_function_highlight = 1
|
||||||
|
let g:cpp_simple_highlight = 1
|
||||||
|
|
||||||
|
" format settings for clang
|
||||||
|
|
||||||
|
let g:clang_format#style_options = {
|
||||||
|
\ "AccessModifierOffset" : -4,
|
||||||
|
\ "AllowShortIfStatementsOnASingleLine" : "true",
|
||||||
|
\ "AlwaysBreakTemplateDeclarations" : "true",
|
||||||
|
\ "Standard" : "C++11",
|
||||||
|
\ "BreakBeforeBraces" : "Stroustrup"}
|
32
neovim_vimscriptonly/nvim/confs/gitSigns.vim
Normal file
32
neovim_vimscriptonly/nvim/confs/gitSigns.vim
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
lua << EOF
|
||||||
|
|
||||||
|
require('gitsigns').setup {
|
||||||
|
signs = {
|
||||||
|
add = {hl = 'DiffAdd' , text = '▌', numhl='GitSignsAddNr'},
|
||||||
|
change = {hl = 'DiffChange', text = '▌', numhl='GitSignsChangeNr'},
|
||||||
|
delete = {hl = 'DiffDelete', text = '_', numhl='GitSignsDeleteNr'},
|
||||||
|
topdelete = {hl = 'DiffDelete', text = '‾', numhl='GitSignsDeleteNr'},
|
||||||
|
changedelete = {hl = 'DiffChange', text = '~', numhl='GitSignsChangeNr'},
|
||||||
|
},
|
||||||
|
numhl = false,
|
||||||
|
keymaps = {
|
||||||
|
-- Default keymap options
|
||||||
|
noremap = true,
|
||||||
|
buffer = true,
|
||||||
|
|
||||||
|
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
|
||||||
|
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
|
||||||
|
|
||||||
|
['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||||
|
['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||||
|
['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||||
|
['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||||
|
['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
||||||
|
},
|
||||||
|
watch_index = {
|
||||||
|
interval = 100
|
||||||
|
},
|
||||||
|
sign_priority = 5,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
}
|
||||||
|
EOF
|
19
neovim_vimscriptonly/nvim/confs/keybinds.vim
Normal file
19
neovim_vimscriptonly/nvim/confs/keybinds.vim
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
" new tab and switching between em
|
||||||
|
|
||||||
|
nnoremap <c-e> : tabnew<CR>
|
||||||
|
nnoremap <c-w> : tabp <CR>
|
||||||
|
nnoremap <c-u> : tabn <CR>
|
||||||
|
|
||||||
|
"nnoremap <silent> <C-m> :%!astyle<CR>
|
||||||
|
nnoremap <silent> <C-a> :%y+<CR>
|
||||||
|
|
||||||
|
map <C-k> <C-w>k
|
||||||
|
map <C-j> <C-w>j
|
||||||
|
map <C-l> <C-w>l
|
||||||
|
map <C-h> <C-w>h
|
||||||
|
|
||||||
|
|
||||||
|
nnoremap ,<space> :Neoformat <CR>
|
||||||
|
nnoremap .<space> :w <CR>
|
||||||
|
|
||||||
|
inoremap kk <ESC>
|
52
neovim_vimscriptonly/nvim/confs/miscSettings.vim
Normal file
52
neovim_vimscriptonly/nvim/confs/miscSettings.vim
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
" open new split panes to right and below
|
||||||
|
set splitright
|
||||||
|
set splitbelow
|
||||||
|
" turn terminal to normal mode with escape
|
||||||
|
tnoremap <Esc> <C-\><C-n>
|
||||||
|
" start terminal in insert mode
|
||||||
|
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
|
||||||
|
|
||||||
|
" open terminal on the bottom
|
||||||
|
function! OpenTerminal()
|
||||||
|
split term://bash
|
||||||
|
resize 10
|
||||||
|
endfunction
|
||||||
|
nnoremap <c-x> :call OpenTerminal()<CR>
|
||||||
|
nnoremap <c-b> :vnew term://bash<CR>
|
||||||
|
|
||||||
|
set updatetime=250 "for gitsigns"
|
||||||
|
let g:tagalong_verbose = 1
|
||||||
|
|
||||||
|
set showtabline=0 " Show tabline
|
||||||
|
set guioptions-=e " Don't use GUI tabline
|
||||||
|
set mouse=a
|
||||||
|
|
||||||
|
" if hidden is not set, TextEdit might fail.
|
||||||
|
set hidden
|
||||||
|
|
||||||
|
" Some servers have issues with backup files, see #649
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
|
||||||
|
" Better display for messages
|
||||||
|
set cmdheight=1
|
||||||
|
|
||||||
|
" don't give |ins-completion-menu| messages.
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
" always show signcolumns
|
||||||
|
set signcolumn=yes
|
||||||
|
|
||||||
|
"hi CustomExplorerBg guibg=#22262C
|
||||||
|
|
||||||
|
"augroup NvimTree
|
||||||
|
" au!
|
||||||
|
" au FileType NvimTree setlocal winhighlight=Normal:CustomExplorerBg
|
||||||
|
"augroup END
|
||||||
|
|
||||||
|
let g:auto_save = 1
|
||||||
|
|
||||||
|
" let mapleader = "'"
|
||||||
|
set ignorecase
|
||||||
|
set noswapfile
|
||||||
|
set title
|
148
neovim_vimscriptonly/nvim/confs/nvimTree.vim
Normal file
148
neovim_vimscriptonly/nvim/confs/nvimTree.vim
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
let g:nvim_tree_side = 'left' "left by default
|
||||||
|
let g:nvim_tree_width = 24 "30 by default
|
||||||
|
let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
|
||||||
|
let g:nvim_tree_auto_open = 0 "0 by default, opens the tree when typing `vim $DIR` or `vim`
|
||||||
|
let g:nvim_tree_auto_close = 0 "0 by default, closes the tree when it's the last window
|
||||||
|
let g:nvim_tree_quit_on_open = 0 "0 by default, closes the tree when you open a file
|
||||||
|
let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer
|
||||||
|
let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open
|
||||||
|
let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.`
|
||||||
|
let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons).
|
||||||
|
let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options
|
||||||
|
let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open
|
||||||
|
let g:nvim_tree_allow_resize = 1 "0 by default, will not resize the tree when opening a file
|
||||||
|
let g:nvim_tree_show_icons = {
|
||||||
|
\ 'git': 1,
|
||||||
|
\ 'folders': 1,
|
||||||
|
\ 'files': 1,
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" default will show icon by default if no icon is provided
|
||||||
|
" default shows no icon by default
|
||||||
|
let g:nvim_tree_icons = {
|
||||||
|
\ 'default': '',
|
||||||
|
\ 'symlink': '',
|
||||||
|
\ 'git': {
|
||||||
|
\ 'unstaged': "✗",
|
||||||
|
\ 'staged': "✓",
|
||||||
|
\ 'unmerged': "",
|
||||||
|
\ 'renamed': "➜",
|
||||||
|
\ 'untracked': "★"
|
||||||
|
\ },
|
||||||
|
\ 'folder': {
|
||||||
|
\ 'default': "",
|
||||||
|
\ 'open': "",
|
||||||
|
\ 'symlink': "",
|
||||||
|
\ }
|
||||||
|
\ }
|
||||||
|
|
||||||
|
"hi LuaTreeIndentMarker guifg=#C8CCD4
|
||||||
|
nnoremap <C-n> :NvimTreeToggle<CR>
|
||||||
|
nnoremap <leader>r :LuaTreeRefresh<CR>
|
||||||
|
nnoremap <leader>n :LuaTreeFindFile<CR>
|
||||||
|
" LuaTreeOpen and LuaTreeClose are also available if you need them
|
||||||
|
|
||||||
|
" a list of groups can be found at `:help nvim_tree_highlight`
|
||||||
|
highlight NvimTreeFolderIcon guifg= #61afef
|
||||||
|
highlight NvimTreeFolderName guifg = #61afef
|
||||||
|
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
|
local get_lua_cb = function (cb_name)
|
||||||
|
return string.format(":lua require'nvim-tree'.on_keypress('%s')<CR>", cb_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Mappings for nvimtree
|
||||||
|
vim.g.nvim_tree_bindings = {
|
||||||
|
["<CR>"] = get_lua_cb("edit"),
|
||||||
|
["o"] = get_lua_cb("edit"),
|
||||||
|
["<2-LeftMouse>"] = get_lua_cb("edit"),
|
||||||
|
["<2-RightMouse>"] = get_lua_cb("cd"),
|
||||||
|
["<C-]>"] = get_lua_cb("cd"),
|
||||||
|
["<C-v>"] = get_lua_cb("vsplit"),
|
||||||
|
["<C-x>"] = get_lua_cb("split"),
|
||||||
|
["<C-t>"] = get_lua_cb("tabnew"),
|
||||||
|
["<BS>"] = get_lua_cb("close_node"),
|
||||||
|
["<S-CR>"] = get_lua_cb("close_node"),
|
||||||
|
["<Tab>"] = get_lua_cb("preview"),
|
||||||
|
["I"] = get_lua_cb("toggle_ignored"),
|
||||||
|
["H"] = get_lua_cb("toggle_dotfiles"),
|
||||||
|
["R"] = get_lua_cb("refresh"),
|
||||||
|
["a"] = get_lua_cb("create"),
|
||||||
|
["d"] = get_lua_cb("remove"),
|
||||||
|
["r"] = get_lua_cb("rename"),
|
||||||
|
["<C-r>"] = get_lua_cb("full_rename"),
|
||||||
|
["x"] = get_lua_cb("cut"),
|
||||||
|
["c"] = get_lua_cb("copy"),
|
||||||
|
["p"] = get_lua_cb("paste"),
|
||||||
|
["[c"] = get_lua_cb("prev_git_item"),
|
||||||
|
["]c"] = get_lua_cb("next_git_item"),
|
||||||
|
["-"] = get_lua_cb("dir_up"),
|
||||||
|
["q"] = get_lua_cb("close"),
|
||||||
|
}
|
||||||
|
|
||||||
|
require'nvim-web-devicons'.setup {
|
||||||
|
-- your personnal icons can go here (to override)
|
||||||
|
-- DevIcon will be appended to `name`
|
||||||
|
override = {
|
||||||
|
html = {
|
||||||
|
icon = "",
|
||||||
|
color = "#DE8C92",
|
||||||
|
name = "html"
|
||||||
|
},
|
||||||
|
css = {
|
||||||
|
icon = "",
|
||||||
|
color = "#61afef",
|
||||||
|
name = "css"
|
||||||
|
},
|
||||||
|
js = {
|
||||||
|
icon = "",
|
||||||
|
color = "#EBCB8B",
|
||||||
|
name = "js"
|
||||||
|
},
|
||||||
|
png = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "png"
|
||||||
|
},
|
||||||
|
jpg = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "jpg"
|
||||||
|
},
|
||||||
|
jpeg = {
|
||||||
|
icon = " ",
|
||||||
|
color = "#BD77DC",
|
||||||
|
name = "jpeg"
|
||||||
|
},
|
||||||
|
mp3 = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "mp3"
|
||||||
|
},
|
||||||
|
mp4 = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "mp4"
|
||||||
|
},
|
||||||
|
out = {
|
||||||
|
icon = "",
|
||||||
|
color = "#C8CCD4",
|
||||||
|
name = "out"
|
||||||
|
},
|
||||||
|
toml = {
|
||||||
|
icon = "",
|
||||||
|
color = "#61afef",
|
||||||
|
name = "toml"
|
||||||
|
},
|
||||||
|
lock = {
|
||||||
|
icon = "",
|
||||||
|
color = "#DE6B74",
|
||||||
|
name = "lock"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
-- globally enable default icons (default to false)
|
||||||
|
-- will get overriden by `get_icons` option
|
||||||
|
default = true;
|
||||||
|
}
|
||||||
|
EOF
|
22
neovim_vimscriptonly/nvim/confs/pluginList.vim
Normal file
22
neovim_vimscriptonly/nvim/confs/pluginList.vim
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
call plug#begin('~/.local/share/nvim/site/plugged')
|
||||||
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
|
Plug 'lewis6991/gitsigns.nvim'
|
||||||
|
Plug 'sbdchd/neoformat'
|
||||||
|
Plug 'glepnir/galaxyline.nvim'
|
||||||
|
"Plug 'tweekmonster/startuptime.vim'
|
||||||
|
Plug 'akinsho/nvim-bufferline.lua'
|
||||||
|
Plug '907th/vim-auto-save'
|
||||||
|
Plug 'michalliu/jsruntime.vim'
|
||||||
|
Plug 'kyazdani42/nvim-tree.lua'
|
||||||
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||||
|
Plug 'chriskempson/base16-vim'
|
||||||
|
Plug 'norcalli/nvim-colorizer.lua'
|
||||||
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
Plug 'alvan/vim-closetag'
|
||||||
|
Plug 'bfrg/vim-cpp-modern'
|
||||||
|
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
|
||||||
|
Plug 'Yggdroot/indentLine'
|
||||||
|
Plug 'ryanoasis/vim-devicons'
|
||||||
|
Plug 'tpope/vim-surround'
|
||||||
|
call plug#end()
|
16
neovim_vimscriptonly/nvim/confs/rust.vim
Normal file
16
neovim_vimscriptonly/nvim/confs/rust.vim
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
" GoTo code navigation.
|
||||||
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
|
|
||||||
|
" Use K to show documentation in preview window.
|
||||||
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
|
|
||||||
|
function! s:show_documentation()
|
||||||
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
|
execute 'h '.expand('<cword>')
|
||||||
|
else
|
||||||
|
call CocAction('doHover')
|
||||||
|
endif
|
||||||
|
endfunction
|
193
neovim_vimscriptonly/nvim/confs/statusline.vim
Normal file
193
neovim_vimscriptonly/nvim/confs/statusline.vim
Normal file
|
@ -0,0 +1,193 @@
|
||||||
|
lua << EOF
|
||||||
|
local gl = require('galaxyline')
|
||||||
|
local gls = gl.section
|
||||||
|
gl.short_line_list = {'LuaTree','vista','dbui'}
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
bg = '#282c34',
|
||||||
|
line_bg = '#282c34',
|
||||||
|
fg = '#D8DEE9',
|
||||||
|
fg_green = '#65a380',
|
||||||
|
yellow = '#A3BE8C',
|
||||||
|
cyan = '#22262C',
|
||||||
|
darkblue = '#61afef',
|
||||||
|
green = '#BBE67E',
|
||||||
|
orange = '#FF8800',
|
||||||
|
purple = '#252930',
|
||||||
|
magenta = '#c678dd',
|
||||||
|
blue = '#22262C';
|
||||||
|
red = '#DF8890',
|
||||||
|
lightbg = '#3C4048',
|
||||||
|
nord = '#81A1C1',
|
||||||
|
greenYel = '#EBCB8B'
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[1] = {
|
||||||
|
leftRounded = {
|
||||||
|
provider = function() return '' end,
|
||||||
|
highlight = { colors.red, colors.bg }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[2] = {
|
||||||
|
ViMode = {
|
||||||
|
provider = function()
|
||||||
|
return ' '
|
||||||
|
end,
|
||||||
|
highlight = {colors.bg,colors.red},
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {colors.lightbg,colors.lightbg},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[3] ={
|
||||||
|
FileIcon = {
|
||||||
|
provider = 'FileIcon',
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.lightbg},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[4] = {
|
||||||
|
FileName = {
|
||||||
|
provider = {'FileName','FileSize'},
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {colors.fg,colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[5] = {
|
||||||
|
teech = {
|
||||||
|
provider = function() return '' end,
|
||||||
|
separator = ' ',
|
||||||
|
highlight = { colors.lightbg, colors.bg }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local checkwidth = function()
|
||||||
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||||
|
if squeeze_width > 40 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
gls.left[6] = {
|
||||||
|
DiffAdd = {
|
||||||
|
provider = 'DiffAdd',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.greenYel,colors.line_bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[7] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = 'DiffModified',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.orange,colors.line_bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[8] = {
|
||||||
|
DiffRemove = {
|
||||||
|
provider = 'DiffRemove',
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.red,colors.line_bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[9] = {
|
||||||
|
LeftEnd = {
|
||||||
|
provider = function() return ' ' end,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {colors.line_bg,colors.line_bg},
|
||||||
|
highlight = {colors.line_bg,colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[10] = {
|
||||||
|
DiagnosticError = {
|
||||||
|
provider = 'DiagnosticError',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.red,colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[11] = {
|
||||||
|
Space = {
|
||||||
|
provider = function () return ' ' end,
|
||||||
|
highlight = {colors.line_bg,colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[12] = {
|
||||||
|
DiagnosticWarn = {
|
||||||
|
provider = 'DiagnosticWarn',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.blue,colors.bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[1] = {
|
||||||
|
GitIcon = {
|
||||||
|
provider = function() return ' ' end,
|
||||||
|
condition = require('galaxyline.provider_vcs').check_git_workspace,
|
||||||
|
highlight = {colors.green,colors.line_bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[2] = {
|
||||||
|
GitBranch = {
|
||||||
|
provider = 'GitBranch',
|
||||||
|
condition = require('galaxyline.provider_vcs').check_git_workspace,
|
||||||
|
highlight = {colors.green,colors.line_bg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[3] = {
|
||||||
|
right_LeftRounded = {
|
||||||
|
provider = function() return '' end,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {colors.bg,colors.bg},
|
||||||
|
highlight = { colors.nord, colors.bg }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[4] = {
|
||||||
|
SiMode = {
|
||||||
|
provider = function()
|
||||||
|
local alias = {
|
||||||
|
n = 'NORMAL',
|
||||||
|
i = 'INSERT',
|
||||||
|
c = 'COMMAND',
|
||||||
|
V = 'VISUAL',
|
||||||
|
[''] = 'VISUAL',
|
||||||
|
v = 'VISUAL',
|
||||||
|
R = 'REPLACE',
|
||||||
|
}
|
||||||
|
return alias[vim.fn.mode()]
|
||||||
|
end,
|
||||||
|
highlight = { colors.bg, colors.nord },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gls.right[5] = {
|
||||||
|
PerCent = {
|
||||||
|
provider = 'LinePercent',
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {colors.nord,colors.nord},
|
||||||
|
highlight = {colors.bg,colors.fg},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[6] = {
|
||||||
|
rightRounded = {
|
||||||
|
provider = function() return '' end,
|
||||||
|
highlight = { colors.fg, colors.bg }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
EOF
|
103
neovim_vimscriptonly/nvim/confs/tabline.vim
Normal file
103
neovim_vimscriptonly/nvim/confs/tabline.vim
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
" Close buffer
|
||||||
|
nnoremap <silent> <A-c> :BufferClose<CR>
|
||||||
|
" Wipeout buffer
|
||||||
|
" :BufferWipeout<CR>
|
||||||
|
" Close commands
|
||||||
|
" :BufferCloseAllButCurrent<CR>
|
||||||
|
" :BufferCloseBuffersRight<CR>
|
||||||
|
nnoremap mymap :lua require"bufferline".go_to_buffer(num)<CR>
|
||||||
|
|
||||||
|
nnoremap <silent>[b :BufferLineCycleNext<CR>
|
||||||
|
nnoremap <silent>b] :BufferLineCyclePrev<CR>
|
||||||
|
|
||||||
|
nnoremap <silent>[n :BufferLineMoveNext<CR>
|
||||||
|
nnoremap <silent>n] :BufferLineMovePrev<CR>
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
|
|
||||||
|
require'bufferline'.setup{
|
||||||
|
options = {
|
||||||
|
buffer_close_icon= '',
|
||||||
|
modified_icon = '●',
|
||||||
|
close_icon = '',
|
||||||
|
left_trunc_marker = '',
|
||||||
|
right_trunc_marker = '',
|
||||||
|
max_name_length = 14,
|
||||||
|
max_prefix_length = 13,
|
||||||
|
tab_size = 18,
|
||||||
|
enforce_regular_tabs = true ,
|
||||||
|
view = "multiwindow" ,
|
||||||
|
show_buffer_close_icons = true ,
|
||||||
|
separator_style = "thin"
|
||||||
|
},
|
||||||
|
|
||||||
|
highlights = {
|
||||||
|
background = {
|
||||||
|
guifg = comment_fg,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
fill = {
|
||||||
|
guifg = comment_fg,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
buffer_selected = {
|
||||||
|
guifg = normal_fg,
|
||||||
|
guibg = '#3A3E44',
|
||||||
|
gui = "bold"
|
||||||
|
},
|
||||||
|
separator_visible = {
|
||||||
|
guifg = '#282c34' ,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
separator_selected = {
|
||||||
|
guifg = '#282c34' ,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
separator = {
|
||||||
|
guifg = '#282c34' ,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
indicator_selected = {
|
||||||
|
guifg = '#282c34' ,
|
||||||
|
guibg = '#282c34'
|
||||||
|
},
|
||||||
|
modified_selected = {
|
||||||
|
guifg = string_fg,
|
||||||
|
guibg = '#3A3E44'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
require('gitsigns').setup {
|
||||||
|
signs = {
|
||||||
|
add = {hl = 'DiffAdd' , text = '▌', numhl='GitSignsAddNr'},
|
||||||
|
change = {hl = 'DiffChange', text = '▌', numhl='GitSignsChangeNr'},
|
||||||
|
delete = {hl = 'DiffDelete', text = '_', numhl='GitSignsDeleteNr'},
|
||||||
|
topdelete = {hl = 'DiffDelete', text = '‾', numhl='GitSignsDeleteNr'},
|
||||||
|
changedelete = {hl = 'DiffChange', text = '~', numhl='GitSignsChangeNr'},
|
||||||
|
},
|
||||||
|
numhl = false,
|
||||||
|
keymaps = {
|
||||||
|
-- Default keymap options
|
||||||
|
noremap = true,
|
||||||
|
buffer = true,
|
||||||
|
|
||||||
|
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
|
||||||
|
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
|
||||||
|
|
||||||
|
['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||||
|
['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||||
|
['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||||
|
['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||||
|
['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
||||||
|
},
|
||||||
|
watch_index = {
|
||||||
|
interval = 100
|
||||||
|
},
|
||||||
|
sign_priority = 5,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
}
|
||||||
|
|
||||||
|
EOF
|
14
neovim_vimscriptonly/nvim/confs/treesitter.vim
Normal file
14
neovim_vimscriptonly/nvim/confs/treesitter.vim
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
lua <<EOF
|
||||||
|
local ts_config = require("nvim-treesitter.configs")
|
||||||
|
|
||||||
|
ts_config.setup {
|
||||||
|
ensure_installed = {
|
||||||
|
"javascript","html","css","bash","cpp","rust"
|
||||||
|
},
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
use_languagetree = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
30
neovim_vimscriptonly/nvim/confs/ui.vim
Normal file
30
neovim_vimscriptonly/nvim/confs/ui.vim
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
let g:indentLine_enabled = 1
|
||||||
|
let g:indentLine_char_list = ['▏']
|
||||||
|
|
||||||
|
set expandtab sw=2
|
||||||
|
|
||||||
|
norm! gg=G
|
||||||
|
highlight EndOfBuffer ctermfg=black ctermbg=black
|
||||||
|
|
||||||
|
" line nums and its fg
|
||||||
|
highlight VertSplit cterm=NONE
|
||||||
|
set numberwidth =1
|
||||||
|
set number
|
||||||
|
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
syntax enable
|
||||||
|
set termguicolors
|
||||||
|
colorscheme base16-onedark
|
||||||
|
|
||||||
|
highlight! Normal guifg=NONE guibg=NONE
|
||||||
|
|
||||||
|
lua require'colorizer'.setup()
|
||||||
|
|
||||||
|
hi LineNr guibg=NONE
|
||||||
|
hi SignColumn guibg=NONE
|
||||||
|
hi VertSplit guibg=NONE
|
||||||
|
|
||||||
|
highlight DiffAdd guifg=#81A1C1 guibg = none
|
||||||
|
highlight DiffChange guifg =#3A3E44 guibg = none
|
||||||
|
highlight DiffModified guifg = #81A1C1 guibg = none
|
18
neovim_vimscriptonly/nvim/init.vim
Normal file
18
neovim_vimscriptonly/nvim/init.vim
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
" ------- run plugins ------
|
||||||
|
source ~/.config/nvim/confs/pluginList.vim
|
||||||
|
|
||||||
|
" ---- keybinds , look of nvim ------
|
||||||
|
source ~/.config/nvim/confs/miscSettings.vim
|
||||||
|
source ~/.config/nvim/confs/keybinds.vim
|
||||||
|
source ~/.config/nvim/confs/ui.vim
|
||||||
|
|
||||||
|
" --- intellisense , linting etc ------
|
||||||
|
source ~/.config/nvim/confs/cpp.vim
|
||||||
|
source ~/.config/nvim/confs/rust.vim
|
||||||
|
source ~/.config/nvim/confs/coc.vim
|
||||||
|
|
||||||
|
" ---- file tree , bufferline and syntax highlighting ------
|
||||||
|
source ~/.config/nvim/confs/treesitter.vim
|
||||||
|
source ~/.config/nvim/confs/nvimTree.vim
|
||||||
|
source ~/.config/nvim/confs/tabline.vim
|
||||||
|
source ~/.config/nvim/confs/statusline.vim
|
Loading…
Reference in a new issue