This commit is contained in:
ksyasuda 2022-01-21 17:21:04 -08:00
parent e52d4d1e6b
commit 5d4b7eee41
7 changed files with 520 additions and 270 deletions

View File

@ -1,96 +1,95 @@
syntax on syntax on
set laststatus=2 "enable status bar set laststatus=2
set number "turn on line numbers set number
set colorcolumn=80 "set color column on col 80 set colorcolumn=80
set tw=80 set tw=80
set shiftwidth=4 set shiftwidth=4
set tabstop=4 set tabstop=4
set autoindent "auto indents code set autoindent
set smartindent "smart indents code set smartindent
set hlsearch "highlight search set hlsearch
set smartcase "set search case based on search query set smartcase
set noerrorbells "no error bells set ignorecase
set title "set title of vim based on file open set noerrorbells
set mouse=a " enable mouse in vim set title
set nospell set mouse=a
set relativenumber
set splitright
set expandtab
set cursorline
set scrolloff=8
set sidescrolloff=8
" show candidates for vim commands with tab
set wildmenu
set encoding=UTF-8 set encoding=UTF-8
set guifont=FiraCode\ Nerd\ Font\ 18 set guifont=FiraCode\ Nerd\ Font\ 18
" lsp handled by coc
let g:ale_disable_lsp = 1
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin'
" Plug 'valloric/youcompleteme'
Plug 'tabnine/YouCompleteMe'
Plug 'sheerun/vim-polyglot'
Plug 'vim-scripts/SQLUtilities'
Plug 'itchyny/vim-gitbranch'
Plug 'ap/vim-css-color'
Plug 'wakatime/vim-wakatime'
Plug 'itchyny/lightline.vim'
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'jiangmiao/auto-pairs'
Plug 'mhinz/vim-startify' Plug 'mhinz/vim-startify'
Plug 'alvan/vim-closetag'
Plug 'MathSquared/vim-python-sql'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'tpope/vim-commentary'
Plug 'dense-analysis/ale'
Plug 'shime/vim-livedown'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug '~/.fzf'
Plug 'tpope/vim-fugitive'
Plug 'kristijanhusak/vim-carbon-now-sh' Plug 'kristijanhusak/vim-carbon-now-sh'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'prabirshrestha/vim-lsp' Plug 'junegunn/fzf.vim'
Plug 'ryanoasis/vim-devicons' Plug 'ryanoasis/vim-devicons'
Plug 'tpope/vim-fugitive'
Plug 'pechorin/any-jump.vim'
Plug 'morhetz/gruvbox' Plug 'tpope/vim-commentary'
Plug 'dracula/vim', { 'as': 'dracula' } Plug 'shime/vim-livedown'
Plug 'jiangmiao/auto-pairs'
Plug 'alvan/vim-closetag'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'ap/vim-css-color'
Plug 'itchyny/lightline.vim'
Plug 'wakatime/vim-wakatime'
Plug 'itchyny/vim-gitbranch'
Plug 'preservim/nerdtree' | Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'sheerun/vim-polyglot'
Plug 'dense-analysis/ale'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'maximbaz/lightline-ale'
" On-demand lazy load
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
" colorschemes
Plug 'joshdick/onedark.vim' Plug 'joshdick/onedark.vim'
Plug 'kaicataldo/material.vim', { 'branch': 'main' } Plug 'kaicataldo/material.vim', { 'branch': 'main' }
Plug 'sainnhe/sonokai'
Plug 'romgrk/doom-one.vim' Plug 'romgrk/doom-one.vim'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end() call plug#end()
let g:doom_one_terminal_colors = v:true "------------------------------------------------------------------------------
" Carbon Now
"------------------------------------------------------------------------------
" carbon now " carbon now
" let g:carbon_now_sh_base_url = 'http://localhost:8888' " let g:carbon_now_sh_base_url = 'http://localhost:8888'
let g:carbon_now_sh_browser = 'firefox' let g:carbon_now_sh_browser = 'firefox'
"jump to remembered position in file if available "jump to remembered position in file if available
if has("autocmd") if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
endif endif
"------------------------------------------------------------------------------
"fzf "fzf
" "------------------------------------------------------------------------------
" This is the default extra key bindings " This is the default extra key bindings
let g:fzf_commands_expect = 'ctrl-enter'
let g:fzf_buffers_jump = 1
let g:fzf_tags_command = 'ctags -R'
" This is the default option:
" - Preview window on the right with 50% width
" - CTRL-/ will toggle preview window.
" - Note that this array is passed as arguments to fzf#vim#with_preview function.
" - To learn more about preview window options, see `--preview-window` section of `man fzf`.
let g:fzf_preview_window = ['right:50%', 'ctrl-/']
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.75 } }
let g:fzf_action = { let g:fzf_action = {
\ 'ctrl-t': 'tab split', \ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split', \ 'ctrl-x': 'split',
@ -109,10 +108,6 @@ let g:fzf_action = {
\ 'ctrl-x': 'split', \ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' } \ 'ctrl-v': 'vsplit' }
"Center of screen and popup
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
" Customize fzf colors to match your color scheme " Customize fzf colors to match your color scheme
" - fzf#wrap translates this to a set of `--color` options " - fzf#wrap translates this to a set of `--color` options
let g:fzf_colors = let g:fzf_colors =
@ -136,7 +131,9 @@ let g:fzf_colors =
" 'previous-history' instead of 'down' and 'up'. " 'previous-history' instead of 'down' and 'up'.
let g:fzf_history_dir = '~/.local/share/fzf-history' let g:fzf_history_dir = '~/.local/share/fzf-history'
"------------------------------------------------------------------------------
"livedown "livedown
"------------------------------------------------------------------------------
" should markdown preview get shown automatically upon opening markdown buffer " should markdown preview get shown automatically upon opening markdown buffer
let g:livedown_autorun = 0 let g:livedown_autorun = 0
" should the browser window pop-up upon previewing " should the browser window pop-up upon previewing
@ -146,6 +143,9 @@ let g:livedown_port = 3001
" the browser to use, can also be firefox, chrome or other, depending on your executable " the browser to use, can also be firefox, chrome or other, depending on your executable
let g:livedown_browser = "firefox" let g:livedown_browser = "firefox"
"------------------------------------------------------------------------------
"ale
"------------------------------------------------------------------------------
function! FormatShell(buffer) abort function! FormatShell(buffer) abort
return { return {
\ 'command': 'shfmt -i=0 -ci -sr' \ 'command': 'shfmt -i=0 -ci -sr'
@ -154,7 +154,6 @@ endfunction
execute ale#fix#registry#Add('shfmt', 'FormatShell', ['sh'], 'shfmt for shell') execute ale#fix#registry#Add('shfmt', 'FormatShell', ['sh'], 'shfmt for shell')
"ale
let g:ale_linter_aliases = {'javascriptreact': ['css', 'javascript'], 'typescriptreact': ['css', 'javascript']} let g:ale_linter_aliases = {'javascriptreact': ['css', 'javascript'], 'typescriptreact': ['css', 'javascript']}
let g:ale_linters = {'javascriptreact': ['css', 'javascript'], 'typescriptreact': ['css', 'javascript'], 'python': ['pylint','pycodestyle', 'pydocstyle'], 'sh': ['shellcheck']} let g:ale_linters = {'javascriptreact': ['css', 'javascript'], 'typescriptreact': ['css', 'javascript'], 'python': ['pylint','pycodestyle', 'pydocstyle'], 'sh': ['shellcheck']}
" Fix files with prettier, and then ESLint. " Fix files with prettier, and then ESLint.
@ -163,7 +162,9 @@ let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'javascri
let g:ale_fix_on_save = 1 let g:ale_fix_on_save = 1
let g:ale_virtualenv_dir_names = ['env'] let g:ale_virtualenv_dir_names = ['env']
"------------------------------------------------------------------------------
"vim-closetag "vim-closetag
"------------------------------------------------------------------------------
" filenames like *.xml, *.html, *.xhtml, ... " filenames like *.xml, *.html, *.xhtml, ...
" These are the file extensions where this plugin is enabled. " These are the file extensions where this plugin is enabled.
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.js,*.ts,*.jsx,*.tsx' let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.js,*.ts,*.jsx,*.tsx'
@ -195,7 +196,9 @@ let g:closetag_regions = {
\ 'javascript.jsx': 'jsxRegion', \ 'javascript.jsx': 'jsxRegion',
\ } \ }
"------------------------------------------------------------------------------
" YOUCOMPLETEME (replaced with coc)
"------------------------------------------------------------------------------
let g:ycm_autoclose_preview_window_after_insertion = 1 "close ycm help window after accepting option let g:ycm_autoclose_preview_window_after_insertion = 1 "close ycm help window after accepting option
let g:ycm_language_server = let g:ycm_language_server =
\ [ \ [
@ -212,6 +215,9 @@ let g:ycm_language_server =
\ ] \ ]
let g:ycm_autoclose_preview_window_after_completion = 1 let g:ycm_autoclose_preview_window_after_completion = 1
"------------------------------------------------------------------------------
" WAKATIME
"------------------------------------------------------------------------------
let g:wakatime_PythonBinary = '/usr/bin/python' " (Default: 'python') let g:wakatime_PythonBinary = '/usr/bin/python' " (Default: 'python')
let g:wakatime_OverrideCommandPrefix = '/usr/bin/wakatime' " (Default: '') let g:wakatime_OverrideCommandPrefix = '/usr/bin/wakatime' " (Default: '')
@ -220,13 +226,14 @@ let vim_markdown_preview_github=1
let vim_markdown_preview_toggle=1 let vim_markdown_preview_toggle=1
let vim_markdown_preview_temp_file=0 let vim_markdown_preview_temp_file=0
"------------------------------------------------------------------------------
"NERDTREE "NERDTREE
"autocmd vimenter * NERDTree "launch nerdtree on vim start "------------------------------------------------------------------------------
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeWinPos = "right" "open nerdtree on the right let g:NERDTreeWinPos = "right" "open nerdtree on the right
let NERDTreeShowHidden=0 "show hidden files use capital 'I' to toggle let NERDTreeShowHidden=0 "show hidden files use capital 'I' to toggle
let g:NERDTreeWinSize=45
"autocmd VimEnter * wincmd p "put the cursor back into the editing pane on start "autocmd VimEnter * wincmd p "put the cursor back into the editing pane on start
let g:NERDTreeGitStatusIndicatorMapCustom = { let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' :'✹', \ 'Modified' :'✹',
\ 'Staged' :'✚', \ 'Staged' :'✚',
@ -244,14 +251,11 @@ let g:NERDTreeGitStatusUseNerdFonts = 1
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif
"avoid crashes when calling vim-plug functions while the cursor is on the NERDTree window "avoid crashes when calling vim-plug functions while the cursor is on the NERDTree window
let g:plug_window = 'noautocmd vertical topleft new' let g:plug_window = 'noautocmd vertical topleft new'
" NERDTress File highlighting " NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#' exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction endfunction
"NERDTree hilight files by extension "NERDTree hilight files by extension
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#282c34') call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#282c34')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#282c34') call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#282c34')
@ -271,7 +275,6 @@ call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#282c34')
call NERDTreeHighlightFile('cpp', 'blue', 'none', 'blue', '#282c34') call NERDTreeHighlightFile('cpp', 'blue', 'none', 'blue', '#282c34')
call NERDTreeHighlightFile('h', 'cyan', 'none', 'cyan', '#282c34') call NERDTreeHighlightFile('h', 'cyan', 'none', 'cyan', '#282c34')
call NERDTreeHighlightFile('txt', 'blue', 'none', 'red', '#282c34') call NERDTreeHighlightFile('txt', 'blue', 'none', 'red', '#282c34')
let g:NERDTreeColorMapCustom = { let g:NERDTreeColorMapCustom = {
\ "Modified" : ["#528AB3", "NONE", "NONE", "NONE"], \ "Modified" : ["#528AB3", "NONE", "NONE", "NONE"],
\ "Staged" : ["#538B54", "NONE", "NONE", "NONE"], \ "Staged" : ["#538B54", "NONE", "NONE", "NONE"],
@ -280,37 +283,64 @@ let g:NERDTreeColorMapCustom = {
\ "Clean" : ["#87939A", "NONE", "NONE", "NONE"] \ "Clean" : ["#87939A", "NONE", "NONE", "NONE"]
\ } \ }
"------------------------------------------------------------------------------
"PRETTIER "PRETTIER
"------------------------------------------------------------------------------
packloadall "enable prettier packloadall "enable prettier
let g:prettier#autoformat = 1 let g:prettier#autoformat = 1
let g:prettier#autoformat_require_pragma = 0 let g:prettier#autoformat_require_pragma = 0
let g:prettier#exec_cmd_path = "/usr/bin/prettier" let g:prettier#exec_cmd_path = "/usr/bin/prettier"
"LIGHTLINE "------------------------------------------------------------------------------
" 'onedark', 'material', 'darcula' " Lightline
let g:lightline = { "------------------------------------------------------------------------------
\ 'colorscheme': 'deus', let g:lightline = {}
\ 'active': { " 'one', 'material', 'darcula', 'deus'
\ 'left': [ [ 'mode', 'paste' ], let g:lightline.colorscheme = "deus"
\ [ 'fugitive', 'filename' ] ], let g:lightline.component_function = {
\ 'right': [ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'charvaluehex', 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'MyFugitive', \ 'fugitive': 'MyFugitive',
\ 'readonly': 'Readonly', \ 'readonly': 'Readonly',
\ 'modified': 'Modified', \ 'modified': 'Modified',
\ 'filename': 'Filename' \ 'filename': 'Filename',
\ \ 'cocstatus': 'coc#status',
\ }, \}
\ 'component': {
\ 'charhexvalue': '0x%B' let g:lightline.component = { 'charhexvalue': '0x%B' }
\ }, let g:lightline.separator = { 'left': "\ue0b0", 'right': "\ue0b2" }
\ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, let g:lightline.subseparator = { 'left': "\ue0b1", 'right': "\ue0b3" }
\ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_infos': 'lightline#ale#infos',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ } \ }
let g:lightline.component_type = {
\ 'linter_checking': 'right',
\ 'linter_infos': 'right',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'right',
\ }
let g:lightline.active = {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'fugitive', 'filename' ] ],
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ],
\ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype'] ] }
let g:lightline#ale#indicator_checking = "\uf110 "
let g:lightline#ale#indicator_infos = "\uf129 "
let g:lightline#ale#indicator_warnings = "\uf071 "
let g:lightline#ale#indicator_errors = "\uf05e "
let g:lightline#ale#indicator_ok = "\uf00c "
" Use autocmd to force lightline update.
autocmd User CocStatusChange,CocDiagnosticChange call lightline#update()
function! Modified() function! Modified()
if &filetype == "help" if &filetype == "help"
return "" return ""
@ -344,35 +374,27 @@ function! Filename()
\ ('' != Modified() ? ' ' . Modified() : '') \ ('' != Modified() ? ' ' . Modified() : '')
endfunction endfunction
"------------------------------------------------------------------------------
"COLORSCHEME "COLORSCHEME
if !has('gui_running') "------------------------------------------------------------------------------
set t_Co=256 set t_Co=256
endif set termguicolors
set noshowmode "disable default vim insert text at bottom set noshowmode "disable default vim insert text at bottom
let g:onedark_termcolors=256 "enable 256 colors let g:onedark_termcolors=256 "enable 256 colors
" packadd! onedark.vim "add onedark colorcheme may not work
" colorscheme onedark "set colorsheme as onedark " colorscheme onedark "set colorsheme as onedark
"material theme "material theme
" let g:material_theme_style = 'default' | 'palenight' | 'ocean' | 'lighter' | 'darker' | 'default-community' | 'palenight-community' | 'ocean-community' | 'lighter-community' | 'darker-community' " let g:material_theme_style = 'default' | 'palenight' | 'ocean' | 'lighter' | 'darker' | 'default-community' | 'palenight-community' | 'ocean-community' | 'lighter-community' | 'darker-community'
let g:material_terminal_italics = 1 let g:material_terminal_italics = 1
let g:material_theme_style = 'darker' let g:material_theme_style = 'darker'
" let g:material_theme_style = 'default' " let g:material_theme_style = 'darker-community'
colorscheme material colorscheme material
let g:doom_one_terminal_colors = v:true
" colorscheme doom-one
"Tokyo night conifg "------------------------------------------------------------------------------
let g:tokyonight_style='night' """bash language server
let g:tokyonight_transparent_background=1 "------------------------------------------------------------------------------
let g:tokyonight_enable_italic=1
"let g:molokai_original = 1
let g:rehash256 = 1
"bash language server
if executable('bash-language-server') if executable('bash-language-server')
au User lsp_setup call lsp#register_server({ au User lsp_setup call lsp#register_server({
\ 'name': 'bash-language-server', \ 'name': 'bash-language-server',
@ -381,15 +403,180 @@ if executable('bash-language-server')
\ }) \ })
endif endif
"------------------------------------------------------------------------------
" NICE COC
"------------------------------------------------------------------------------
set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("nvim-0.5.0") || has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
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.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" 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>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
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,python,py,sh,bash setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Run the Code Lens action on the current line.
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
"------------------------------------------------------------------------------
" custom commands
"------------------------------------------------------------------------------
command! Reload execute "source ~/.vimrc"
command! Config execute ":e ~/.vimrc"
"------------------------------------------------------------------------------
"KEYBINDINGS "KEYBINDINGS
map <C-c> :nohls<Cr> "------------------------------------------------------------------------------
map <F2> :NERDTreeToggle<CR> let mapleader = "\<Space>"
map <C-n> :NERDTreeToggle<CR>
map <C-s> <Plug>(Prettier)
map<C-c> :nohls<CR>
map <F5> :! map <F5> :!
map <C-T> :ter++close<CR> map <C-n> :NERDTreeToggle<CR>
map <C-D> :YcmShowDetailedDiagnostic<CR>
map <C-l> :LivedownToggle<CR> map <C-l> :LivedownToggle<CR>
map <C-o> :FZF ~<CR> nnoremap <C-T> :wa<CR>:vertical botright term ++kill=term<CR>
" fzf
nmap // :CocCommand fzf-preview.Lines<CR>
nmap ?? :CocCommand fzf-preview.BufferLines<CR>
nmap <leader>sf :FZF<CR>
" buffers
nmap <leader>bb :CocCommand fzf-preview.Buffers<CR>
nmap <leader>bB :CocCommand fzf-preview.AllBuffers<CR>
nmap <leader>bk :bdelete<CR>
nmap <leader>bn :enew<CR>
" git
nmap <leader>gg :tab term ++close lazygit<CR>
nmap <leader>gc :CocCommand fzf-preview.GitLogs<CR>
nmap <leader>gf :CocCommand fzf-preview.GitFiles<CR>
nmap <leader>gs :CocCommand fzf-preview.GitStatus<CR>
" help
nmap <leader>hc :CocCommand fzf-preview.CommandPalette<CR>
nmap <leader>hk :Maps<CR>
" any jump plugin
nmap <leader>j :AnyJump<CR>
" toggle/open
nmap <leader>on :NERDTreeToggle<CR>
nmap <leader>ot :vertical botright ter<CR>
" peek/preview
nmap <leader>pr :CocCommand fzf-preview.CocReferences<Cr>
nmap <leader>pi :CocCommand fzf-preview.CocImplementations<Cr>
nmap <leader>pd :CocCommand fzf-preview.CocDiagnostics<Cr>
" search
nmap <leader>sc :nohls<Cr>
"toggle coc outline
nmap <leader>to :CocOutline<CR>
"which key
set timeoutlen=400
nnoremap <silent> <leader> :WhichKey '<Space>'<CR>

View File

@ -10,12 +10,13 @@ fi
#If you come from bash you might have to change your $PATH. #If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH # export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/home/sudacode/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
export PATH="$HOME/scripts:$PATH" export PATH="$HOME/scripts:$PATH"
export PATH="$HOME/Work/scripts:$PATH" export PATH="$HOME/Work/scripts:$PATH"
export PATH="$HOME/Work/rofi/:$PATH" export PATH="$HOME/Work/rofi/:$PATH"
export PATH="$HOME/.bin:$PATH" export PATH="$HOME/.bin:$PATH"
export PATH="$HOME/Projects/Python/Sudasong/src/:$PATH" export PATH="$HOME/Projects/Python/Sudasong/src/:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export EDITOR=vim export EDITOR=vim
export VISUAL=vim export VISUAL=vim
@ -223,29 +224,29 @@ PS2="===>"
# # Add gem to PATH # # Add gem to PATH
# export PATH=$PATH:/home/sudacode/.gem/ruby/2.7.0/bin # export PATH=$PATH:/home/sudacode/.gem/ruby/2.7.0/bin
# #
# # Add go to PATH # # Add go to PATH
# export PATH=$PATH:/home/sudacode/go/bin # export PATH=$PATH:/home/sudacode/go/bin
# #
# alias freud='cd /home/sudacode/' # alias freud='cd /home/sudacode/'
# #
# # Add yarn to PATH # # Add yarn to PATH
# export PATH="$PATH:`yarn global bin`" # export PATH="$PATH:`yarn global bin`"
# #
# # set terminal color to 256 color # # set terminal color to 256 color
# export TERM=xterm-256color export TERM=xterm-256color
# #
# export PATH=$PATH:/home/sudacode/.local/bin # export PATH=$PATH:/home/sudacode/.local/bin
# #
# add emacs to path # add emacs to path
export PATH=$PATH:/home/sudacode/.emacs.d/bin export PATH=$PATH:/home/sudacode/.emacs.d/bin
# #
#Enable tab completions for flags in colorls #Enable tab completions for flags in colorls
source $(dirname $(gem which colorls))/tab_complete.sh source $(dirname $(gem which colorls))/tab_complete.sh
# #
# # add pythno to PATH # # add pythno to PATH
# export PATH="$PATH:/usr/bin/python" # export PATH="$PATH:/usr/bin/python"
# #
# # add jdk-8 to path # # add jdk-8 to path
# export PATH="$PATH:/usr/lib/jvm/java-8-openjdk/bin" # export PATH="$PATH:/usr/lib/jvm/java-8-openjdk/bin"
# export CLASSPATH="$CLASSPATH:/usr/share/java/mariadb-jdbc/mariadb-java-client.jar" # export CLASSPATH="$CLASSPATH:/usr/share/java/mariadb-jdbc/mariadb-java-client.jar"
@ -261,7 +262,9 @@ ibus-daemon -drx
export VISUAL=vim export VISUAL=vim
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_DIR="$HOME/.cache" export XDG_CACHE_DIR="$HOME/.cache"
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" # export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
bindkey '^ ' autosuggest-accept
# source the Xmodmap file to get custom keybindings # source the Xmodmap file to get custom keybindings
@ -287,3 +290,10 @@ export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
# # <<< conda initialize <<< # # <<< conda initialize <<<
# neofetch # neofetch
# added by Snowflake SnowSQL installer
export PATH=/home/sudacode/.bin:$PATH
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/yubikey-agent/yubikey-agent.sock"
eval $(thefuck --alias)

View File

@ -2,47 +2,22 @@
lvim.log.level = "warn" lvim.log.level = "warn"
lvim.format_on_save = true lvim.format_on_save = true
lvim.colorscheme = "onedarker" lvim.colorscheme = "onedarker"
lvim.leader = "space" lvim.leader = "space"
lvim.keys.normal_mode["<C-s>"] = ":w<cr>" lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
-- custom settings
local init_custom_options = function()
local custom_options = {
relativenumber = true,
colorcolumn = "80",
scrolloff = 10,
ignorecase = true,
smartcase = true,
}
for k, v in pairs(custom_options) do
vim.opt[k] = v
end
end
init_custom_options()
lvim.builtin.dashboard.active = true lvim.builtin.dashboard.active = true
lvim.builtin.terminal.active = true lvim.builtin.terminal.active = true
-- Nvimtree -- Nvimtree
lvim.builtin.nvimtree.setup.view.side = "left" lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.nvimtree.show_icons.git = 1 lvim.builtin.nvimtree.show_icons.git = 1
lvim.builtin.nvimtree.hide_dotfiles = 0 lvim.builtin.nvimtree.hide_dotfiles = 0
-- Treesitter -- Treesitter
lvim.builtin.treesitter.highlight.enabled = true lvim.builtin.treesitter.highlight.enabled = true
lvim.builtin.treesitter.matchup.enable = true lvim.builtin.treesitter.matchup.enable = true
lvim.builtin.treesitter.context_commentstring.enable = true lvim.builtin.treesitter.context_commentstring.enable = true
local components = require("lvim.core.lualine.components") local components = require("lvim.core.lualine.components")
lvim.builtin.lualine.sections.lualine_a = { "mode" } lvim.builtin.lualine.sections.lualine_a = { "mode" }
lvim.builtin.lualine.sections.lualine_c = { components.python_env } lvim.builtin.lualine.sections.lualine_c = { components.python_env }
lvim.builtin.lualine.sections.lualine_y = { lvim.builtin.lualine.sections.lualine_y = { components.location, }
components.location,
}
lvim.builtin.treesitter.ensure_installed = { lvim.builtin.treesitter.ensure_installed = {
"bash", "bash",
"c", "c",
@ -55,11 +30,14 @@ lvim.builtin.treesitter.ensure_installed = {
"rust", "rust",
"java", "java",
"yaml", "yaml",
"dockerfile",
"markdown",
"make"
} }
lvim.builtin.treesitter.ignore_install = { "haskell" } lvim.builtin.treesitter.ignore_install = { "haskell" }
lvim.builtin.treesitter.highlight.enabled = true lvim.builtin.treesitter.highlight.enabled = true
-- formatters
local formatters = require "lvim.lsp.null-ls.formatters" local formatters = require "lvim.lsp.null-ls.formatters"
formatters.setup { formatters.setup {
{ exe = "black", filetypes = { "python" } }, { exe = "black", filetypes = { "python" } },
@ -72,20 +50,21 @@ formatters.setup {
{ exe = "shfmt", filetypes = { "shell", "sh" }, args = {'-i=0','-sr', '-ci'} }, { exe = "shfmt", filetypes = { "shell", "sh" }, args = {'-i=0','-sr', '-ci'} },
} }
-- -- set additional linters -- linters
local linters = require "lvim.lsp.null-ls.linters" local linters = require "lvim.lsp.null-ls.linters"
linters.setup { linters.setup {
{ exe = "flake8", filetypes = { "python" } }, { exe = "flake8", filetypes = { "python" } },
{ {
exe = "shellcheck", exe = "shellcheck",
fieltypes = { "shell" }, filetypes = { "shell", "sh" },
args = { "--severity", "warning" }, args = { "--severity", "warning", "--shell", "/bin/bash", "--enable", "check-unassigned-uppercase,add-default-case,deprecate-which" },
} },
} }
-- lsp signature cfg
local lsp_signature_cfg = { local lsp_signature_cfg = {
debug = false, -- set to true to enable debug logging debug = false, -- set to true to enable debug logging
log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on -- log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
-- default is ~/.cache/nvim/lsp_signature.log -- default is ~/.cache/nvim/lsp_signature.log
verbose = false, -- show debug line number verbose = false, -- show debug line number
@ -109,7 +88,7 @@ local lsp_signature_cfg = {
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
max_height = 20, -- max height of signature floating_window, if content is more than max_height, you can scroll down max_height = 20, -- max height of signature floating_window, if content is more than max_height, you can scroll down
-- to view the hiding contents -- to view the hiding contents
max_width = 150, -- max_width of signature floating_window, line will be wrapped if exceed max_width max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width
handler_opts = { handler_opts = {
border = "rounded" -- double, rounded, single, shadow, none border = "rounded" -- double, rounded, single, shadow, none
}, },
@ -122,11 +101,11 @@ local lsp_signature_cfg = {
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc
transparency = nil, -- disabled by default, allow floating win transparent value 1~100 transparency = 85, -- disabled by default, allow floating win transparent value 1~100
shadow_blend = 36, -- if you using shadow as border use this set the opacity shadow_blend = 36, -- if you using shadow as border use this set the opacity
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
toggle_key = nil -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>' toggle_key = '<C-l>' -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
} }
-- Additional Plugins -- Additional Plugins
@ -150,7 +129,7 @@ lvim.plugins = {
"rmagatti/goto-preview", "rmagatti/goto-preview",
config = function() config = function()
require('goto-preview').setup { require('goto-preview').setup {
width = 120; -- Width of the floating window width = 100; -- Width of the floating window
height = 25; -- Height of the floating window height = 25; -- Height 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
@ -188,6 +167,8 @@ lvim.plugins = {
'wakatime/vim-wakatime', 'wakatime/vim-wakatime',
'ap/vim-css-color', 'ap/vim-css-color',
"p00f/nvim-ts-rainbow", "p00f/nvim-ts-rainbow",
"tzachar/cmp-tabnine",
"onsails/lspkind-nvim"
} }
-- add jedi_language_server -- add jedi_language_server
@ -201,16 +182,96 @@ require'lspconfig'.sqlls.setup{}
-- require('lspconfig').bashls.setup{} -- require('lspconfig').bashls.setup{}
require'lspconfig'.bashls.setup{} require'lspconfig'.bashls.setup{}
-- Setup nvim-cmp.
local cmp = require'cmp'
-- cmp.setup({
-- snippet = {
-- -- REQUIRED - you must specify a snippet engine
-- expand = function(args)
-- -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- end,
-- },
-- mapping = {
-- ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
-- ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
-- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
-- ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
-- ['<C-e>'] = cmp.mapping({
-- i = cmp.mapping.abort(),
-- c = cmp.mapping.close(),
-- }),
-- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
-- },
-- sources = cmp.config.sources({
-- { name = 'nvim_lsp' },
-- }, {
-- { name = 'buffer' },
-- })
-- })
-- -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
-- cmp.setup.cmdline('/', {
-- sources = {
-- { name = 'buffer' }
-- }
-- })
-- -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
-- cmp.setup.cmdline(':', {
-- sources = cmp.config.sources({
-- { name = 'path' }
-- }, {
-- { name = 'cmdline' }
-- })
-- })
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require('lspconfig')['jedi_language_server'].setup {
capabilities = capabilities
}
require('lspconfig')['bashls'].setup {
capabilities = capabilities
}
require('lspconfig')['dockerls'].setup {
capabilities = capabilities
}
require('lspconfig')['jsonls'].setup {
capabilities = capabilities
}
require('lspconfig')['sumneko_lua'].setup {
capabilities = capabilities
}
require('lspconfig')['pyright'].setup {
capabilities = capabilities
}
require('lspconfig')['dotls'].setup {
capabilities = capabilities
}
require('lspconfig')['yamlls'].setup {
capabilities = capabilities
}
require('lspconfig')['html'].setup {
capabilities = capabilities
}
require('lspconfig')['eslint'].setup {
capabilities = capabilities
}
-- lsp_signature -- lsp_signature
require'lsp_signature'.setup() -- require'lsp_signature'.setup(lsp_signature_cfg)
require('goto-preview').setup { require('goto-preview').setup {
width = 220; -- Width of the floating window width = 150; -- Width of the floating window
height = 55; -- Height of the floating window height = 45; -- Height of the floating window
border = {"", "" ,"", "", "", "", "", ""}; -- Border characters of the floating window border = {"", "" ,"", "", "", "", "", ""}; -- Border characters of the floating window
default_mappings = true; -- Bind default mappings default_mappings = true; -- 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 = 55; -- 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.
-- 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.
@ -227,7 +288,7 @@ vim.g.symbols_outline = {
auto_preview = true, auto_preview = true,
position = 'right', position = 'right',
relative_width = true, relative_width = true,
width = 25, width = 30,
show_numbers = false, show_numbers = false,
show_relative_numbers = false, show_relative_numbers = false,
show_symbol_details = true, show_symbol_details = true,
@ -273,89 +334,81 @@ vim.g.symbols_outline = {
} }
} }
vim.api.nvim_set_keymap("n", "ss", "<cmd>SymbolsOutline<CR>", {noremap=true}) -- lsp-kind
local lspkind = require('lspkind')
cmp.setup {
formatting = {
format = lspkind.cmp_format({
with_text = false, -- do not show text alongside icons
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- Setup nvim-cmp. -- The function below will be called before any actual modifications from lspkind
local cmp = require'cmp' -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
-- before = function (entry, vim_item)
cmp.setup({ -- ...
snippet = { -- return vim_item
-- REQUIRED - you must specify a snippet engine -- end
expand = function(args) })
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
mapping = {
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
} }
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require('lspconfig')['jedi_language_server'].setup {
capabilities = capabilities
}
require('lspconfig')['bashls'].setup {
capabilities = capabilities
}
require('lspconfig')['dockerls'].setup {
capabilities = capabilities
}
require('lspconfig')['jsonls'].setup {
capabilities = capabilities
}
require('lspconfig')['sumneko_lua'].setup {
capabilities = capabilities
}
require('lspconfig')['pyright'].setup {
capabilities = capabilities
}
require('lspconfig')['dotls'].setup {
capabilities = capabilities
}
require('lspconfig')['yamlls'].setup {
capabilities = capabilities
}
require('lspconfig')['html'].setup {
capabilities = capabilities
}
require('lspconfig')['eslint'].setup {
capabilities = capabilities
} }
-- tabnine
require'cmp'.setup {
sources = {
{ name = 'cmp_tabnine' },
},
}
local source_mapping = {
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
cmp_tabnine = "[TN]",
path = "[Path]",
}
require'cmp'.setup {
sources = {
{ name = 'cmp_tabnine' },
},
formatting = {
format = function(entry, vim_item)
vim_item.kind = lspkind.presets.default[vim_item.kind]
local menu = source_mapping[entry.source.name]
if entry.source.name == 'cmp_tabnine' then
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
menu = entry.completion_item.data.detail .. ' ' .. menu
end
vim_item.kind = ''
end
vim_item.menu = menu
return vim_item
end
},
}
-- custom settings
local init_custom_options = function()
local custom_options = {
relativenumber = true,
colorcolumn = "80",
scrolloff = 10,
ignorecase = true,
smartcase = true,
tabstop = 4,
shiftwidth = 4,
undofile = false,
}
for k, v in pairs(custom_options) do
vim.opt[k] = v
end
end
init_custom_options()
-- move windows to right side of screen
vim.cmd("autocmd! BufEnter * if &ft ==# 'help' | wincmd L | endif")
vim.cmd("autocmd! BufEnter * if &ft ==# 'man' | wincmd L | endif")
-- Autocommands (https://neovim.io/doc/user/autocmd.html) -- Autocommands (https://neovim.io/doc/user/autocmd.html)
-- lvim.autocommands.custom_groups = { -- lvim.autocommands.custom_groups = {
-- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" }, -- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },

View File

@ -12,9 +12,10 @@
;; Use pywal.sh in scripts directory to use colors from an image/wallpaper. ;; Use pywal.sh in scripts directory to use colors from an image/wallpaper.
;; main colors ;; main colors
background = #3B4252 ; background = #464b55
background = "#24282f"
; background-alt = #4C566A ; background-alt = #4C566A
background-alt = "#464b55" background-alt = #3B4252
foreground = #ECEFF4 foreground = #ECEFF4
; foreground-alt = #E5E9F0 ; foreground-alt = #E5E9F0
foreground-alt = "#abb2bf" foreground-alt = "#abb2bf"

View File

@ -67,7 +67,7 @@ height = 40
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%) ; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
; the percentage can optionally be extended with a pixel offset like so: ; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in an offset in the x or y direction ; 50%:-10, this will result in an offset in the x or y direction
; of 50% minus 10 pixels ; of 50% minus 10 pixels
offset-x = 2.5% offset-x = 2.5%
offset-y = 0% offset-y = 0%
@ -80,10 +80,10 @@ foreground = ${color.foreground}
; Background gradient (vertical steps) ; Background gradient (vertical steps)
; background-[0-9]+ = #aarrggbb ; background-[0-9]+ = #aarrggbb
;;background-0 = ;;background-0 =
; Value used for drawing rounded corners ; Value used for drawing rounded corners
; Note: This shouldn't be used together with border-size because the border ; Note: This shouldn't be used together with border-size because the border
; doesn't get rounded ; doesn't get rounded
; Individual top/bottom values can be defined using: ; Individual top/bottom values can be defined using:
; radius-{top,bottom} ; radius-{top,bottom}
@ -145,7 +145,7 @@ font-4 = "Source Han Sans JP:size=8;3"
; modules-center = xwindow xbacklight ; modules-center = xwindow xbacklight
; modules-right = ipc clock ; modules-right = ipc clock
modules-left = sep launcher sep i3-workspaces sep chrome flameshot color-picker modules-left = sep launcher sep bspwm-workspaces sep chrome flameshot color-picker
; modules-left = sep launcher sep bspwm-workspaces sep chrome flameshot color-picker ; modules-left = sep launcher sep bspwm-workspaces sep chrome flameshot color-picker
modules-center = title-icon title sep cust-mpd-icon cust-mpd-prev custom-mpd cust-mpd-next modules-center = title-icon title sep cust-mpd-icon cust-mpd-prev custom-mpd cust-mpd-next
; modules-right = color-switch sep alsa sep battery sep network sep date sep sysmenu sep ; modules-right = color-switch sep alsa sep battery sep network sep date sep sysmenu sep
@ -163,7 +163,7 @@ dim-value = 1.0
; If the value is empty or undefined, the atom value ; If the value is empty or undefined, the atom value
; will be created from the following template: polybar-[BAR]_[MONITOR] ; will be created from the following template: polybar-[BAR]_[MONITOR]
; NOTE: The placeholders are not available for custom values ; NOTE: The placeholders are not available for custom values
wm-name = i3 wm-name = bspwm
; Locale used to localize various module data (e.g. date) ; Locale used to localize various module data (e.g. date)
; Expects a valid libc locale, for example: sv_SE.UTF-8 ; Expects a valid libc locale, for example: sv_SE.UTF-8
@ -187,7 +187,7 @@ tray-detached = false
; Tray icon max size ; Tray icon max size
tray-maxsize = 24 tray-maxsize = 24
; Background color for the tray container ; Background color for the tray container
; ARGB color (e.g. #f00, #ff992a, #ddff1023) ; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar ; By default the tray container will use the bar
; background color. ; background color.
@ -212,7 +212,7 @@ tray-scale = 1.0
; Currently supported WM's: ; Currently supported WM's:
; bspwm ; bspwm
; i3 (requires: `override-redirect = true`) ; i3 (requires: `override-redirect = true`)
wm-restack = i3 wm-restack = bspwm
; Set a DPI values used when rendering text ; Set a DPI values used when rendering text
; This only affects scalable fonts ; This only affects scalable fonts
@ -224,8 +224,8 @@ enable-ipc = true
; Fallback click handlers that will be called if ; Fallback click handlers that will be called if
; there's no matching module handler found. ; there's no matching module handler found.
click-left = click-left =
click-middle = click-middle =
click-right = click-right =
; scroll-up = ; scroll-up =
; scroll-down = ; scroll-down =
@ -239,7 +239,7 @@ double-click-right =
; - pointer : Typically in the form of a hand ; - pointer : Typically in the form of a hand
; - ns-resize : Up and down arrows, can be used to indicate scrolling ; - ns-resize : Up and down arrows, can be used to indicate scrolling
cursor-click = pointer cursor-click = pointer
cursor-scroll = cursor-scroll =
;; WM Workspace Specific ;; WM Workspace Specific
@ -286,8 +286,8 @@ compositing-underline = over
compositing-border = over compositing-border = over
; Define fallback values used by all module formats ; Define fallback values used by all module formats
;format-foreground = ;format-foreground =
;format-background = ;format-background =
;format-underline = ;format-underline =
;format-overline = ;format-overline =
;format-spacing = ;format-spacing =

View File

@ -114,7 +114,7 @@ set preview_images true
# Preview images in full color with the external command "ueberzug". # Preview images in full color with the external command "ueberzug".
# Images are shown by using a child window. # Images are shown by using a child window.
# Only for users who run X11 in GNU/Linux. # Only for users who run X11 in GNU/Linux.
set preview_images_method w3m set preview_images_method ueberzug
# Delay in seconds before displaying an image with the w3m method. # Delay in seconds before displaying an image with the w3m method.
# Increase it in case of experiencing display corruption. # Increase it in case of experiencing display corruption.

View File

@ -4,7 +4,7 @@
--embed-subs --embed-subs
# Always extract audio # Always extract audio
-x # -x
# Do not copy the mtime # Do not copy the mtime
--no-mtime --no-mtime
@ -12,4 +12,3 @@
# Save all videos under YouTube directory in your home directory # Save all videos under YouTube directory in your home directory
-o ~/Videos/YouTube/%(title)s.%(ext)s -o ~/Videos/YouTube/%(title)s.%(ext)s