Something went wrong. Try again.
Something went wrong. Try again.
8.4 kB · 359 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360" vim: set foldmethod=marker foldmarker=[[[,]]] foldlevel=0 nomodeline :
" [[[ General Settings
set exrcset hiddenset modelineset modelines=2set nomodelineexprset secure
set encoding=utf-8set expandtabset shiftwidth=0set tabstop=2
set incsearchset ignorecaseset smartcaseset wildmenu
set nostartoflineset splitbelowset splitrightif exists('&splitkeep') set splitkeep=screenendif
set updatetime=1000
set clipboard=unnamed
set mouse=a
set undofile
" <Leader> and <LocalLeader>let mapleader = "\<Space>"let maplocalleader = "\\"
" General Settings ]]]
" [[[ General Keymaps
" beginning/end of linennoremap B ^nnoremap E $onoremap B ^onoremap E $xnoremap B ^xnoremap E $
" disable Ctrl-a on screen/tmuxif $TERM =~ 'screen\|tmux' nnoremap <C-a> <Nop> nnoremap <Leader><C-a> <C-a>endif
" savennoremap <Leader>s :update<CR>nnoremap <Leader>js :noautocmd update<CR>
" move linesinoremap <M-j> <Esc>:move .+1<CR>==giinoremap <M-k> <Esc>:move .-2<CR>==ginnoremap <M-j> :move .+1<CR>==nnoremap <M-k> :move .-2<CR>==vnoremap <M-j> :move '>+1<CR>gv=gvvnoremap <M-k> :move '<-2<CR>gv=gv
" yank from the cursor position to the end of the linennoremap Y y$" yank/paste with system clipboardnnoremap <Leader>y "+yvnoremap <Leader>y "+ynnoremap <Leader>Y "+y$vnoremap <Leader>Y "+y$nnoremap <Leader>p "+pvnoremap <Leader>p "+pnnoremap <Leader>P "+Pvnoremap <Leader>P "+P" paste in visual mode keeping the yankxnoremap _p "_dP
" make new splitnnoremap <C-w>- :rightbelow new<CR>nnoremap <C-w>_ :botright new<CR>nnoremap <C-w>\ :rightbelow vnew<CR>nnoremap <C-w>\| :botright vnew<CR>
" centered search navigation (`zv` mimics `foldopen=search`)nnoremap n nzzzvnnoremap N Nzzzv
" General Keymaps ]]]
" [[[ FileType Specific Settings
"" [[[ FileType: help
augroup help_custom_setting autocmd! autocmd FileType help nnoremap <buffer> gq :quit<CR> autocmd FileType help nnoremap <silent><buffer> K :execute 'h ' . expand('<cword>')<CR>augroup END
"" FileType: help ]]]
"" [[[ FileType: json
autocmd BufNewFile,BufRead tsconfig*.json setlocal filetype=jsoncautocmd FileType jsonc syntax match Comment +\/\/.\+$+
"" FileType: json ]]]
"" [[[ FileType: tmux
autocmd FileType tmux nnoremap <silent><buffer> K :call tmux#man()<CR>
"" FileType: tmux ]]]
"" [[[ FileType: vim
autocmd FileType vim nnoremap <silent><buffer> K :execute 'h ' . expand('<cword>')<CR>
"" FileType: vim ]]]
" FileType Specific Settings ]]]
" [[[ Plugin Initialization
"" [[[ Plugin: fzf
let g:fzf_action = { \ 'ctrl-t': 'tab split', \ 'ctrl-s': 'split', \ 'ctrl-v': 'vsplit' \ }
let g:fzf_command_prefix = 'Z'
if has('nvim') || has('popupwin') " fzf in popup window let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'BoxChar' } }endif
"" Plugin: fzf ]]]
"" [[[ Plugin: git-messenger
let g:git_messenger_no_default_mappings = v:truelet g:git_messenger_always_into_popup = v:true
"" Plugin: git-messenger ]]]
"" [[[ Plugin: hexokinase
let g:Hexokinase_highlighters = ['foreground']
"" Plugin: hexokinase ]]]
"" [[[ Plugin: matchup
" disable built-in matchit.vimlet g:loaded_matchit = 1
let g:matchup_matchparen_deferred = 1let g:matchup_matchparen_offscreen = {}let g:matchup_mouse_enabled = 0let g:matchup_text_obj_enabled = 0
""Plugin: matchup ]]]
"" [[[ Plugin: maximizer
let g:maximizer_default_mapping_key = '<M-m>'
"" Plugin: maximizer ]]]
"" [[[ Plugin: tmux-navigator
let g:tmux_navigator_disable_when_zoomed = 1let g:tmux_navigator_no_mappings = 1
"" Plugin: tmux-navigator ]]]
"" [[[ Plugin: tmux-resizer
let g:tmux_resizer_no_mappings = 1let g:tmux_resizer_resize_count = 5let g:tmux_resizer_vertical_resize_count = 10
"" Plugin: tmux-resizer ]]]
" Plugin Initialization ]]]
if has('nvim') lua require('config')else let vim_specific_config_file = fnamemodify(expand('<sfile>'), ':h') . '/vim.vim' if filereadable(vim_specific_config_file) execute "source " . vim_specific_config_file endifendif
" [[[ Plugin Settings
"" [[[ Plugin: camelcasemotion
map <silent> <M-w> <Plug>CamelCaseMotion_wmap <silent> <M-b> <Plug>CamelCaseMotion_bmap <silent> <M-e> <Plug>CamelCaseMotion_emap <silent> g<M-e> <Plug>CamelCaseMotion_gesunmap <M-w>sunmap <M-b>sunmap <M-e>sunmap g<M-e>imap <silent> <S-Left> <C-o><Plug>CamelCaseMotion_bimap <silent> <S-Right> <C-o><Plug>CamelCaseMotion_w
"" Plugin: camelcasemotion ]]]
"" [[[ Plugin: carbon-now-sh
let g:carbon_now_sh_options = { \ 'bg': '#8f3f71', \ 'ln': 'true', \ 'fm': 'JetBrains Mono', \ 'wc': 'false', \ 't': 'monokai' }
"" Plugin: carbon-now-sh ]]]
"" [[[ Plugin: fzf
" hide statusline while fzf-ingif has('nvim') && !exists('g:fzf_layout') autocmd! FileType fzf autocmd FileType fzf set laststatus=0 nonumber noshowmode noruler \| autocmd BufLeave <buffer> set laststatus=2 number showmode rulerendif
" better ripgrep command: ZRGcommand! -nargs=* -bang ZRG call RipgrepFzf(<q-args>, <bang>0)function! RipgrepFzf(query, fullscreen) let command_fmt = '[ -n %s ] && rg --column --line-number --no-heading --color=always --smart-case -- %s || true' let initial_command = printf(command_fmt, shellescape(a:query), shellescape(a:query)) let reload_command = printf(command_fmt, '{q}', '{q}') let spec = {'options': ['--disabled', '--prompt', 'Search > ', '--query', a:query, '--bind', 'change:reload:'.reload_command]} let spec = fzf#vim#with_preview(spec, 'right', 'ctrl-/') call fzf#vim#grep(initial_command, 1, spec, a:fullscreen)endfunction
" keymaps: fzfnmap <C-p> :ZFiles<CR>nmap <Leader>/ :ZLines<CR>nmap <Leader>? :ZRG<CR>nmap <Leader>b :ZBuffers<CR>nmap <Leader>w :ZWindows<CR>
"" Plugin: fzf ]]]
"" [[[ Plugin: easy-align
" keymaps: easy-align"" Start interactive EasyAlign in visual mode (e.g. vipga)xmap ga <Plug>(EasyAlign)"" Start interactive EasyAlign for a motion/text object (e.g. gaip)nmap ga <Plug>(EasyAlign)
"" Plugin: easy-align ]]]
"" [[[ Plugin: fugitive
" keymaps: fugitivenmap <Leader>gs :G<CR>
"" Plugin: fugitive ]]]
"" [[[ Plugin: git-messenger
" keymaps: git-messengernmap <Leader>og <Plug>(git-messenger)
function! s:setup_git_messenger_popup() abort nmap <buffer><Esc> <Plug>(git-messenger-close)endfunctionautocmd FileType gitmessengerpopup call <SID>setup_git_messenger_popup()
"" Plugin: git-messenger ]]]
"" [[[ Plugin: tmux-navigator
nnoremap <silent> <C-w>h :TmuxNavigateLeft<CR>nnoremap <silent> <C-w><C-h> :TmuxNavigateLeft<CR>nnoremap <silent> <C-w>j :TmuxNavigateDown<CR>nnoremap <silent> <C-w><C-j> :TmuxNavigateDown<CR>nnoremap <silent> <C-w>k :TmuxNavigateUp<CR>nnoremap <silent> <C-w><C-k> :TmuxNavigateUp<CR>nnoremap <silent> <C-w>l :TmuxNavigateRight<CR>nnoremap <silent> <C-w><C-l> :TmuxNavigateRight<CR>nnoremap <silent> <C-w>p :TmuxNavigatePrevious<CR>nnoremap <silent> <C-w><C-p> :TmuxNavigatePrevious<CR>
"" Plugin: tmux-navigator ]]]
"" [[[ Plugin: tmux-resizer
nnoremap <silent> <C-w><M-h> :TmuxResizeLeft<CR>nnoremap <silent> <C-w><M-j> :TmuxResizeDown<CR>nnoremap <silent> <C-w><M-k> :TmuxResizeUp<CR>nnoremap <silent> <C-w><M-l> :TmuxResizeRight<CR>
"" Plugin: tmux-resizer ]]]
" Plugin Settings ]]]
" [[[ Appearance Settings
set cursorlineset number relativenumberset nowrapset scrolloff=5
" always show the signcolumn, otherwise it would shift the text each time diagnostics appear/become resolved.set signcolumn=yes
" fold settingsset foldlevelstart=15set foldminlines=3
syntax enable
augroup override_highlight autocmd! autocmd ColorScheme gruvbox highlight link BoxChar GruvboxGray \ | highlight link CocExplorerIndentLine BoxCharaugroup END
" themeset background=dark
let g:gruvbox_inverse=0let g:gruvbox_italic=1let g:gruvbox_contrast_dark='hard'let g:gruvbox_contrast_light='hard'let g:gruvbox_invert_selection='0'colorscheme gruvbox
" automatically toggle relative line numberaugroup auto_relativenumber_toggle autocmd! autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &l:nu | setl rnu | endif autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &l:nu | setl nornu | endifaugroup END
" Appearance Settings ]]]
" Everything that can happen, happens. It has to end well and it has to end badly. It has to end every way it can.