BIG REFACTOR; PLEASE BE ADVISED
finally going to commit that zshrc refactor - smolvsdefault on altaria - i3-utils refactor - no need for custom scwrypt executable anymore - time to say goodbye to the old dotwryn.env in favor of the new and improved rc.ds - vim/rc.d refactor + QuickREPL and QuickCommand replacements for \r and \t - going to stop tracking Archives explicitly until new hard drive - tty-colorscheme is now referenced directly - colorscheme/spring-sunset needed to swap primary/secondary colors for focus in i3 since it was confusing - setup config no longer needs to create ~/.config/wryn/env.vim; added some dependencies to arch-linux - switch from dmenu to rofi by default; allow .i3 overrides in colorschemes; tty-colorscheme is now referenced directly
This commit is contained in:
25
vim/rc.d/00.plugin-vundle.vim
Normal file
25
vim/rc.d/00.plugin-vundle.vim
Normal file
@ -0,0 +1,25 @@
|
||||
if !isdirectory(expand("$HOME/.vim/bundle/Vundle.vim")) | let g:plugins_ok = 0 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
set nocompatible
|
||||
filetype off
|
||||
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
|
||||
call vundle#begin()
|
||||
Plugin 'VundleVim/Vundle.vim' " 00.plugin-vundle.vim
|
||||
Plugin 'valloric/youcompleteme' " 01.plugin-youcompleteme.vim
|
||||
Plugin 'w0rp/ale' " 02.plugin-ale.vim
|
||||
Plugin 'scrooloose/nerdtree' " 03.plugin-nerdtree.vim
|
||||
Plugin 'tpope/vim-surround' " 04.plugin-vim-surround.vim
|
||||
Plugin 'tpope/vim-fugitive' " 05.plugin-vim-fugitive.vim
|
||||
Plugin 'jeffkreeftmeijer/vim-dim' " 07.plugin-vim-dim.vim
|
||||
Plugin 'chrisbra/unicode.vim' " 08.plugin-unicode.vim
|
||||
Plugin 'rrethy/vim-hexokinase' " 09.plugin-vim-hexokinase.vim
|
||||
Plugin 'fatih/vim-go' " 10.plugin-vim-go.vim
|
||||
Plugin 'rust-lang/rust.vim' " 11.plugin-rust.vim
|
||||
" ---------------------------------------------------------------------
|
||||
call vundle#end()
|
||||
|
||||
filetype plugin indent on
|
||||
let g:plugins_ok = 1
|
29
vim/rc.d/01.plugin-youcompleteme.vim
Normal file
29
vim/rc.d/01.plugin-youcompleteme.vim
Normal file
@ -0,0 +1,29 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
||||
let g:ycm_goto_buffer_command = 'new-tab'
|
||||
let g:ycm_auto_hover = ''
|
||||
|
||||
let g:preferred_rust_root = trim(system("rustup toolchain list -v | grep default | sed 's|[^/]*||'"))
|
||||
|
||||
if isdirectory(g:preferred_rust_root)
|
||||
let g:ycm_rust_toolchain_root = g:preferred_rust_root
|
||||
endif
|
||||
|
||||
function! ToggleYCM()
|
||||
if g:ycm_auto_trigger
|
||||
let g:ycm_auto_trigger = 0
|
||||
echohl DiffDelete | echo "YouCompleteMe autocompletion disabled" | echohl None
|
||||
else
|
||||
let g:ycm_auto_trigger = 1
|
||||
echohl DiffAdd | echo "YouCompleteMe autocompletion enabled" | echohl None
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <S-y> :call ToggleYCM()<CR>
|
||||
nnoremap gd :YcmCompleter GoToDefinition<CR>
|
||||
|
||||
augroup ycm_hover
|
||||
autocmd FileType rust,typescript,javascript,python nnoremap <silent><buffer> ? <Plug>(YCMHover)
|
||||
augroup end
|
26
vim/rc.d/02.plugin-ale.vim
Normal file
26
vim/rc.d/02.plugin-ale.vim
Normal file
@ -0,0 +1,26 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:ale_linters = {
|
||||
\ 'cs' : ['OmniSharp'],
|
||||
\ 'python' : ['pylint'],
|
||||
\ 'go' : ['golint'],
|
||||
\ 'rust' : ['analyzer'],
|
||||
\}
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ 'javascript': ['prettier'],
|
||||
\ 'typescript': ['prettier'],
|
||||
\ 'rust': ['rustfmt'],
|
||||
\}
|
||||
|
||||
let g:ale_lint_on_text_changed = 0
|
||||
let g:ale_lint_on_insert_leave = 0
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_sign_column_always = 1
|
||||
|
||||
nnoremap <Leader>at <Plug>(ale_toggle_buffer)
|
||||
nnoremap <Leader>ae <Plug>(ale_next)
|
||||
nnoremap <Leader>ad :YcmDiags<CR> " requires 01.plugin-youcompleteme.vim
|
||||
nnoremap <Leader>ar <Plug>(ale_previous)
|
||||
nnoremap <Leader>f <Plug>(ale_fix)
|
5
vim/rc.d/03.plugin-nerdtree.vim
Normal file
5
vim/rc.d/03.plugin-nerdtree.vim
Normal file
@ -0,0 +1,5 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
nnoremap <C-o> :NERDTreeToggle %<CR>
|
||||
let g:NERDTreeNodeDelimiter = "\u00a0" " -- fixes ^G character
|
3
vim/rc.d/04.plugin-vim-surround.vim
Normal file
3
vim/rc.d/04.plugin-vim-surround.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
9
vim/rc.d/05.plugin-vim-fugitive.vim
Normal file
9
vim/rc.d/05.plugin-vim-fugitive.vim
Normal file
@ -0,0 +1,9 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
" I'm not really convinced this is a useful plugin for me; keeping it
|
||||
" around for a bit longer to see if I find some fantastic way I work
|
||||
" well with it since it is very popular :)
|
||||
|
||||
" \g git fugitive shortcuts
|
||||
nnoremap <Leader>gb :Git blame<CR>
|
3
vim/rc.d/07.plugin-vim-dim.vim
Normal file
3
vim/rc.d/07.plugin-vim-dim.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
4
vim/rc.d/08.plugin-unicode.vim
Normal file
4
vim/rc.d/08.plugin-unicode.vim
Normal file
@ -0,0 +1,4 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
imap <C-U> <Plug>(UnicodeFuzzy)
|
4
vim/rc.d/09.plugin-vim-hexokinase.vim
Normal file
4
vim/rc.d/09.plugin-vim-hexokinase.vim
Normal file
@ -0,0 +1,4 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:Hexokinase_highlighters = ['foregroundfull']
|
8
vim/rc.d/10.plugin-vim-go.vim
Normal file
8
vim/rc.d/10.plugin-vim-go.vim
Normal file
@ -0,0 +1,8 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:go_imports_autosave = 0
|
||||
let g:go_def_mapping_enabled = 0
|
||||
let g:go_fmt_fail_silently = 1
|
||||
let g:go_def_reuse_buffer = 1
|
||||
let g:go_textobj_enabled = 0
|
3
vim/rc.d/11.plugin-rust.vim
Normal file
3
vim/rc.d/11.plugin-rust.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
11
vim/rc.d/20.options.vim
Normal file
11
vim/rc.d/20.options.vim
Normal file
@ -0,0 +1,11 @@
|
||||
set encoding=utf-8 formatoptions=lj
|
||||
|
||||
set number relativenumber
|
||||
set showtabline=2 tabpagemax=42
|
||||
set autoindent smartindent linebreak breakindent breakindentopt=shift:3
|
||||
|
||||
set timeoutlen=200
|
||||
set showmatch matchtime=0
|
||||
set backspace=indent,eol,start
|
||||
|
||||
set spellfile=$DOTWRYN/vim/en.utf-8.add spelllang=en
|
7
vim/rc.d/30.utility.vim
Normal file
7
vim/rc.d/30.utility.vim
Normal file
@ -0,0 +1,7 @@
|
||||
function EnsureTmuxSession()
|
||||
call system("tmux new -ds " . g:escapeTmuxSession . " -c $HOME >/dev/null 2>&1")
|
||||
endfunction
|
||||
|
||||
function FindGitRoot()
|
||||
return finddir('.git/..', expand('%:p:h').';')
|
||||
endfunction
|
80
vim/rc.d/31.utility-execute.vim
Normal file
80
vim/rc.d/31.utility-execute.vim
Normal file
@ -0,0 +1,80 @@
|
||||
"
|
||||
" escape-to-shell execution wrapper with great functionality
|
||||
" and an OK-to-bad API (EXTREMELY helpful)
|
||||
"
|
||||
|
||||
let escapeTmuxSession = "vim-exec"
|
||||
let escapeTmuxPaneID = g:escapeTmuxSession . ":0.0"
|
||||
|
||||
let escapeCommandOutputs = ['tmux', 'split-pane-vertical', 'split-pane-horizontal']
|
||||
|
||||
function ExecuteCommand(args = '', output = '', flavor = 'shell', syntax = 'bash')
|
||||
let output = a:output
|
||||
if output == ''
|
||||
let output = GetPrefferredCommandOutput()
|
||||
endif
|
||||
|
||||
let command = GetCommandString(a:args, a:flavor, output)
|
||||
|
||||
if output == 'tmux'
|
||||
silent call EnsureTmuxSession()
|
||||
call system("tmux send-keys -t ".g:escapeTmuxPaneID." '".command."' Enter")
|
||||
silent call system("tmux display-popup -E 'tmux a -t ".g:escapeTmuxSession."' &")
|
||||
elseif output == 'split-pane-horizontal'
|
||||
execute "botright terminal " . command
|
||||
let &l:syntax=a:syntax
|
||||
elseif output == 'split-pane-vertical'
|
||||
execute "botright vertical terminal " . command
|
||||
let &l:syntax=a:syntax
|
||||
else
|
||||
execute "!" . command
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function GetCommandString(args, flavor, output)
|
||||
let command = ''
|
||||
let gitRoot = FindGitRoot()
|
||||
|
||||
if a:flavor == 'shell'
|
||||
let command = a:args
|
||||
|
||||
elseif a:flavor == 'npm'
|
||||
let command = 'npm test ' . a:args
|
||||
if gitRoot != ''
|
||||
let command = 'cd ' . gitRoot . '; ' . command
|
||||
endif
|
||||
|
||||
elseif a:flavor == 'django'
|
||||
let command = './manage.py test --keepdb ' . a:args
|
||||
if gitRoot != ''
|
||||
let command = 'cd ' . gitRoot . '; ' . command
|
||||
endif
|
||||
endif
|
||||
|
||||
if stridx(a:output, 'tmux') != -1
|
||||
let command = command.";"
|
||||
\ . " echo \"-----------------------------\" | lolcat;"
|
||||
\ . " echo \"(ENTER to close, C^c to stay)\";"
|
||||
\ . " read </dev/tty;"
|
||||
\ . " tmux detach-client" " omit final ';'
|
||||
echom command
|
||||
endif
|
||||
|
||||
if stridx(a:output, 'split-pane') == -1
|
||||
let command = "clear; ".command
|
||||
endif
|
||||
|
||||
return command
|
||||
endfunction
|
||||
|
||||
function GetPrefferredCommandOutput()
|
||||
for output in g:escapeCommandOutputs
|
||||
if stridx(output, 'tmux') != -1 && executable('tmux')
|
||||
return output
|
||||
elseif stridx(output, 'split-pane') != -1 && v:version >= 800
|
||||
return output
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 'shell-escape'
|
||||
endfunction
|
13
vim/rc.d/32.utility-scwrypts.vim
Normal file
13
vim/rc.d/32.utility-scwrypts.vim
Normal file
@ -0,0 +1,13 @@
|
||||
"
|
||||
" 31.utility-execute.vim wrapper for scwrypts-specific execution
|
||||
"
|
||||
|
||||
function ExecuteScwrypt(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
let b:scwryptsPrevArgs = a:args
|
||||
call ExecuteCommand('scwrypts -n ' . a:scwrypt . ' -- ' . a:args, a:output, 'shell', a:syntax)
|
||||
echom 'scwrypts -n ' . a:scwrypt . '--' . a:args
|
||||
endfunction
|
||||
|
||||
function ExecuteScwryptInteractive(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
call ExecuteScwrypt(a:scwrypt, a:args . input('scwrypts ' . a:scwrypt . '--' . a:args), a:output, a:syntax)
|
||||
endfunction
|
59
vim/rc.d/34.utility-quick-repl.vim
Normal file
59
vim/rc.d/34.utility-quick-repl.vim
Normal file
@ -0,0 +1,59 @@
|
||||
"
|
||||
" quickly open a REPL with <Leader>r
|
||||
"
|
||||
" tries to guess based on configuration + filetype what repl to use,
|
||||
" otherwise asks the user to provide the required REPL command
|
||||
" for the current buffer
|
||||
"
|
||||
" always uses the last used REPL type unless specified otherwise
|
||||
" in the :call arguments
|
||||
"
|
||||
|
||||
let g:quickrepl_commands_by_filetype = {
|
||||
\ 'python': 'bpython',
|
||||
\ 'zsh': 'zsh',
|
||||
\ 'bash': 'bash',
|
||||
\ 'typescript': 'node',
|
||||
\ 'javascript': 'node',
|
||||
\}
|
||||
|
||||
let g:quickrepl_output_format_default = 'split-pane-horizontal'
|
||||
let g:quickrepl_output_format_overrides_by_repl_command = {
|
||||
\ 'bpython': 'split-pane-vertical',
|
||||
\ 'node': 'split-pane-vertical',
|
||||
\ 'zsh': 'split-pane-vertical',
|
||||
\}
|
||||
|
||||
let g:quickrepl_repl_command_args_by_repl_command= {
|
||||
\ 'zsh': '-l',
|
||||
\}
|
||||
|
||||
function QuickREPL(repl = '')
|
||||
let l:repl = a:repl
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = get(b:, 'quick_repl', '')
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = get(g:quickrepl_commands_by_filetype, &filetype, '')
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = input('input a repl command : ') | redraw
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
echohl DiffDelete | echo "no command supplied; canceled REPL execution" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let b:quick_repl = l:repl
|
||||
|
||||
let l:output = get(g:quickrepl_output_format_overrides_by_repl_command, l:repl, g:quickrepl_output_format_default)
|
||||
let l:repl_args = get(g:quickrepl_repl_command_args, l:repl, '')
|
||||
|
||||
call ExecuteCommand(l:repl . ' ' . l:repl_args, l:output)
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>r :call QuickREPL()<CR>
|
43
vim/rc.d/35.utility-quick-command.vim
Normal file
43
vim/rc.d/35.utility-quick-command.vim
Normal file
@ -0,0 +1,43 @@
|
||||
"
|
||||
" quickly run a custom command with <Leader>t
|
||||
"
|
||||
" this is a safer version of what used to be my 'quicktest'
|
||||
" bindings; sometimes I don't have the time to create a proper
|
||||
" language/technology-specific testing utility, and would
|
||||
" rather run a quick SHELL command at the touch of a button
|
||||
"
|
||||
" this safer, upgrade to the previous bindings (listed below)
|
||||
" requires buffer-level specificity and does not allow quick
|
||||
" commands to bleed between vim sessions and buffers; this
|
||||
" has saved me from some accidental push-to-main-with-admin-power
|
||||
" situations which arose from the previous bindings
|
||||
"
|
||||
" previously:
|
||||
"
|
||||
" " \t = run last quicktest
|
||||
" " t)ype new quicktest
|
||||
" " e)dit last quicktest
|
||||
" nnoremap <Leader>t q:?^echom 'quicktest'<CR><CR><CR>
|
||||
" nnoremap <Leader>tt q:oechom 'quicktest' \| call ExecuteCommand('')<ESC>F'i
|
||||
" nnoremap <Leader>te q:?^echom 'quicktest'<CR>
|
||||
"
|
||||
|
||||
let g:quick_command_output_format = 'split-pane-horizontal'
|
||||
|
||||
function QuickCommand()
|
||||
let l:quick_command = get(b:, 'quick_command', '')
|
||||
if ( l:quick_command == '' )
|
||||
let l:quick_command = input('input quick command : ') | redraw
|
||||
endif
|
||||
|
||||
if ( l:quick_command == '' )
|
||||
echohl DiffDelete | echo "no command supplied; canceled execution" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let b:quick_command = l:quick_command
|
||||
|
||||
call ExecuteCommand(l:quick_command, g:quick_command_output_format)
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>t :call QuickCommand()<CR>
|
17
vim/rc.d/39.utility-misc.vim
Normal file
17
vim/rc.d/39.utility-misc.vim
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
function Sudowrite()
|
||||
execute 'w !sudo tee "%"'
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader><Leader>w :call Sudowrite()<CR>
|
||||
|
||||
function MakeFileExecutable(sudo = 0)
|
||||
if a:sudo
|
||||
execute '! sudo chmod +x "%"'
|
||||
else
|
||||
execute '! chmod +x "%"'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader><Leader>x :call MakeFileExecutable(0)<CR>
|
||||
nnoremap <Leader><Leader>xx :call MakeFileExecutable(1)<CR>
|
63
vim/rc.d/41.file-formatting.vim
Normal file
63
vim/rc.d/41.file-formatting.vim
Normal file
@ -0,0 +1,63 @@
|
||||
" --- custom format settings ------------------------------------------
|
||||
" {{{
|
||||
function FormatFileType(indent, expandtab, foldmethod, foldlevel, spell)
|
||||
let &l:tabstop = a:indent
|
||||
let &l:softtabstop = a:indent
|
||||
let &l:shiftwidth = a:indent
|
||||
|
||||
let &l:expandtab = a:expandtab
|
||||
|
||||
let &l:foldmethod = a:foldmethod
|
||||
let &l:foldlevel = a:foldlevel
|
||||
|
||||
let &l:spell = a:spell
|
||||
endfunction
|
||||
|
||||
augroup forced_filetype_recognition
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.tmux setfiletype tmux
|
||||
autocmd BufRead,BufNewFile *.clisp setfiletype lisp
|
||||
autocmd BufRead,BufNewFile *.lsp setfiletype lisp
|
||||
autocmd BufRead,BufNewFile Dockerfile* setfiletype dockerfile
|
||||
autocmd BufRead,BufNewFile *i3.conf setfiletype i3config
|
||||
autocmd BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation
|
||||
autocmd BufRead,BufNewFile git.conf setfiletype gitconfig
|
||||
|
||||
autocmd BufRead,BufNewFile */scwrypts/* execute "set filetype=".&filetype.".scwrypts"
|
||||
|
||||
let g:tex_flavor = "latex"
|
||||
augroup end
|
||||
|
||||
augroup filetype_specific_formatting
|
||||
autocmd!
|
||||
autocmd FileType python call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType java call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType cpp call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType cmake call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType cs call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType css call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType sass call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType html call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType javascript call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType typescript call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType vim call FormatFileType(4, v:false, 'marker', 99, v:false)
|
||||
autocmd FileType sh call FormatFileType(4, v:false, 'indent', 99, v:false)
|
||||
autocmd FileType zsh call FormatFileType(4, v:false, 'indent', 99, v:false)
|
||||
autocmd FileType lisp call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType markdown call FormatFileType(2, v:false, 'indent', 99, v:true )
|
||||
autocmd FileType tex call FormatFileType(8, v:false, 'indent', 99, v:true )
|
||||
autocmd FileType postscr call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType haskell call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType perl call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType kotlin call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType dockerfile call FormatFileType(4, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType vue call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
autocmd FileType go call FormatFileType(4, v:false, 'manual', 99, v:false)
|
||||
autocmd FileType json call FormatFileType(2, v:false, 'indent', 99, v:false)
|
||||
autocmd FileType smarty call FormatFileType(2, v:true, 'indent', 99, v:false)
|
||||
augroup end
|
||||
|
||||
let g:markdown_fenced_languages = ['javascript', 'json', 'python', 'bash', 'yaml', 'shell=zsh', 'sql']
|
||||
" }}}
|
||||
|
||||
syntax on
|
71
vim/rc.d/42.file-execute.vim
Normal file
71
vim/rc.d/42.file-execute.vim
Normal file
@ -0,0 +1,71 @@
|
||||
nnoremap <Leader>ec :execute b:executeDefault<CR>
|
||||
nnoremap <Leader>ei :execute b:executeInteractive<CR>
|
||||
nnoremap <Leader>eb :execute b:executeBuild<CR>
|
||||
nnoremap <Leader>ef :execute b:executeFormat<CR>
|
||||
nnoremap <Leader>et :execute b:executeTest<CR>
|
||||
|
||||
" --- (e)xe(c)ute -----------------------------------------------------
|
||||
" (i)nteractive
|
||||
" (b)uild
|
||||
" auto-(f)ormat
|
||||
" (t)ests
|
||||
" {{{
|
||||
augroup file_specific_commands
|
||||
autocmd!
|
||||
|
||||
autocmd FileType * let b:executeDefault = "call ExecuteCommand('%:p', 'split-pane-horizontal')"
|
||||
autocmd FileType * let b:executeInteractive = "call ExecuteCommand('%:p ' . input(expand('%').' -- '), 'split-pane-horizontal')"
|
||||
autocmd FileType * let b:executeBuild = "echohl ErrorMsg | echom 'ERROR: no build steps defined' | echohl None"
|
||||
autocmd FileType * let b:executeFormat = "%s/\\s\\+$//"
|
||||
autocmd FileType * let b:executeTest = "echohl ErrorMsg | echom 'ERROR: no test steps defined' | echohl None"
|
||||
|
||||
autocmd FileType go let b:executeDefault = "!clear<CR><CR>q:?GoRun<CR><CR>"
|
||||
autocmd FileType go let b:executeFormat = "<Plug>(go-imports)"
|
||||
autocmd FileType go nnoremap <silent> gd <Plug>(go-def-tab)
|
||||
|
||||
autocmd FileType markdown let b:executeDefault = '!google-chrome-stable %:p'
|
||||
|
||||
autocmd FileType python let b:executeDefault = "call ExecuteCommand('python %:p', 'split-pane-vertical')"
|
||||
autocmd FileType python let b:executeInteractive = "call ExecuteCommand('bpython -qi %:p ' . input(expand('%').' -- '), 'split-pane-vertical')"
|
||||
|
||||
autocmd FileType tex let b:executeDefault = 'call ExecuteScwrypt("latex/open-pdf", "%:p")'
|
||||
autocmd FileType tex let b:executeBuild = 'call ExecuteScwrypt("latex/build-pdf", "%:p")'
|
||||
autocmd FileType tex let b:executeFormat = 'call ExecuteScwrypt("latex/cleanup", "%:p")'
|
||||
|
||||
autocmd FileType yaml let b:scwryptDefault = "--group scwrypts --type zsh --name helm/get-template "
|
||||
autocmd FileType yaml let b:scwryptBuild = "--group scwrypts --type zsh --name helm/update-dependencies "
|
||||
autocmd FileType yaml let b:scwryptArgs = "--template-filename %:p "
|
||||
autocmd FileType yaml let b:executeDefault = 'call ExecuteScwrypt(b:scwryptDefault, b:scwryptArgs . "--raw ", "split-pane-vertical", "yaml")'
|
||||
autocmd FileType yaml let b:executeInteractive = 'call ExecuteScwryptInteractive(b:scwryptDefault, b:scwryptArgs, "split-pane-vertical", "yaml")'
|
||||
autocmd FileType yaml let b:executeBuild = 'call ExecuteScwrypt(b:scwryptBuild, b:scwryptArgs, "split-pane-vertical", "yaml")'
|
||||
autocmd FileType yaml let b:executeTest = 'call ExecuteScwrypt(b:scwryptDefault, b:scwryptArgs, "split-pane-vertical", "yaml")'
|
||||
|
||||
autocmd FileType rust let b:executeDefault = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeDefault = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeInteractive = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet -- ' . input('cargo run -- ') . '\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeInteractive = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet -- ' . input('cargo run -- ') . '\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeBuild = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo build\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeBuild = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo build\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeTest = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo test\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeTest = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo test\"', 'split-pane-horizontal')"
|
||||
|
||||
" --- OVERRIDES ---------------------------- "
|
||||
|
||||
autocmd FileType *.scwrypts let b:scwryptsType = ""
|
||||
autocmd FileType zsh.scwrypts let b:scwryptsType = "zsh"
|
||||
autocmd FileType python.scwrypts let b:scwryptsType = "py"
|
||||
autocmd FileType javascript.scwrypts let b:scwryptsType = "zx"
|
||||
autocmd FileType typescript.scwrypts let b:scwryptsType = "zx"
|
||||
|
||||
autocmd FileType *.scwrypts let b:scwryptsSubPath = substitute(substitute(expand("%:p"), ".*\.scwrypts/", "", ""), "^".b:scwryptsType."/", "", "")
|
||||
autocmd FileType *.scwrypts let b:scwryptsAutoName = b:scwryptsType . " " . substitute(substitute(b:scwryptsSubPath, ".[a-z]\\+$", "", ""), "/", " ", "g") . " "
|
||||
autocmd FileType *.scwrypts let b:scwryptsPrevArgs = ' '
|
||||
autocmd FileType *.scwrypts let b:scwryptsEnvs = split(system('scwrypts --list-envs'), '\n')
|
||||
autocmd FileType *.scwrypts let b:scwryptsEnvChoices = split(system('echo SCWRYPTS_ENV=; scwrypts --list-envs | awk "{print \"\"NR\". \"\$0}"'), '\n')
|
||||
|
||||
autocmd FileType *.scwrypts let b:executeDefault = "call ExecuteScwrypt(b:scwryptsAutoName, ' ', 'split-pane-vertical')"
|
||||
autocmd FileType *.scwrypts let b:executeInteractive = "call ExecuteScwryptInteractive(b:scwryptsAutoName, ' ', 'split-pane-vertical')"
|
||||
autocmd FileType *.scwrypts let b:executeBuild = "let $SCWRYPTS_ENV=b:scwryptsEnvs[inputlist(b:scwryptsEnvChoices) - 1]"
|
||||
autocmd FileType *.scwrypts let b:executeTest = "call ExecuteScwrypt(b:scwryptsAutoName, b:scwryptsPrevArgs, 'split-pane-vertical')"
|
||||
augroup end
|
||||
" }}}
|
8
vim/rc.d/70.bindings.vim
Normal file
8
vim/rc.d/70.bindings.vim
Normal file
@ -0,0 +1,8 @@
|
||||
" backslash for Leader and backspace for LocalLeader
|
||||
nmap <BS> <Nop>
|
||||
let mapleader = "\\"
|
||||
let maplocalleader = "\<BS>"
|
||||
|
||||
" (e)dit / (s)ource (v)imrc
|
||||
nnoremap <Leader>ev :tabedit $VIMRC<CR>
|
||||
nnoremap <Leader>sv :source $VIMRC<CR>
|
25
vim/rc.d/71.bindings-navigation.vim
Normal file
25
vim/rc.d/71.bindings-navigation.vim
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
" (shift + direction) for tabs
|
||||
nnoremap <S-l> gt
|
||||
nnoremap <S-h> gT
|
||||
nnoremap <S-t> <C-w>T
|
||||
|
||||
" (ctrl + direction) for panes
|
||||
nnoremap <C-l> <C-w>l
|
||||
nnoremap <C-h> <C-w>h
|
||||
nnoremap <C-j> <C-w>j
|
||||
nnoremap <C-k> <C-w>k
|
||||
tnoremap <C-l> <C-w>l
|
||||
tnoremap <C-h> <C-w>h
|
||||
tnoremap <C-j> <C-w>j
|
||||
tnoremap <C-k> <C-w>k
|
||||
|
||||
" (ctrl + n/p) for buffers
|
||||
nnoremap <C-n> :n<CR>
|
||||
nnoremap <C-p> :N<CR>
|
||||
|
||||
" flip (gf) / (ctrl+w gf) bindings
|
||||
nnoremap <C-w>gf gf
|
||||
vnoremap <C-w>gf gf
|
||||
nnoremap gf <C-w>gf
|
||||
vnoremap gf <C-w>gf
|
20
vim/rc.d/80.color.vim
Normal file
20
vim/rc.d/80.color.vim
Normal file
@ -0,0 +1,20 @@
|
||||
set t_Co=256 t_8f=[38:2:%lu:%lu:%lum t_8b=[48:2:%lu:%lu:%lum t_ZH=[3m t_ZR=[23m t_Cs=[4:3m t_Ce=[4:0m
|
||||
|
||||
colorscheme default
|
||||
silent! colorscheme dim
|
||||
|
||||
highlight Normal ctermbg=NONE guibg=NONE
|
||||
highlight SignColumn ctermbg=NONE guibg=NONE
|
||||
highlight LineNr ctermbg=NONE guibg=NONE ctermfg=darkmagenta guifg=darkmagenta
|
||||
|
||||
highlight SpellBad cterm=bold gui=bold ctermbg=NONE guibg=NONE ctermfg=red guifg=red
|
||||
|
||||
highlight TabLineFill cterm=bold gui=bold ctermbg=NONE guibg=NONE
|
||||
highlight TabLine cterm=NONE gui=NONE ctermbg=NONE guibg=NONE ctermfg=darkgray guifg=darkgray
|
||||
highlight TabLineSel cterm=bold gui=bold ctermbg=NONE guibg=NONE ctermfg=white guifg=white
|
||||
|
||||
highlight ALEVirtualTextError cterm=nocombine,italic,undercurl gui=nocombine,italic ctermbg=NONE ctermfg=yellow guibg=NONE guifg=yellow
|
||||
highlight ALEVirtualTextWarning cterm=nocombine,italic,undercurl gui=nocombine,italic ctermbg=NONE ctermfg=yellow guibg=NONE guifg=yellow
|
||||
highlight ALEVirtualTextInfo cterm=nocombine,italic,undercurl gui=nocombine,italic ctermbg=NONE ctermfg=yellow guibg=NONE guifg=yellow
|
||||
highlight ALEVirtualTextStyleError cterm=nocombine,italic,undercurl gui=nocombine,italic ctermbg=NONE ctermfg=yellow guibg=NONE guifg=yellow
|
||||
highlight ALEVirtualTextStyleWarning cterm=nocombine,italic,undercurl gui=nocombine,italic ctermbg=NONE ctermfg=yellow guibg=NONE guifg=yellow
|
13
vim/rc.d/90.override-rentdynamics.vim
Normal file
13
vim/rc.d/90.override-rentdynamics.vim
Normal file
@ -0,0 +1,13 @@
|
||||
augroup rent_dynamics
|
||||
autocmd!
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.cs setlocal tabstop=2 softtabstop=2 shiftwidth=2
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.ts* setlocal tabstop=2 softtabstop=2 shiftwidth=2
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.scss setlocal tabstop=2 softtabstop=2 shiftwidth=2
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.less setlocal tabstop=2 softtabstop=2 shiftwidth=2
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.css setlocal tabstop=2 softtabstop=2 shiftwidth=2
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/*.cshtml setlocal tabstop=2 softtabstop=2 shiftwidth=2 filetype=html
|
||||
|
||||
autocmd BufRead,BufEnter,BufNewFile */RentDynamics/leo-lead-mgmt/* setlocal tabstop=4 softtabstop=4 shiftwidth=4
|
||||
|
||||
autocmd BufRead,BufNewFile */RentDynamics/* setlocal foldmethod=indent foldlevel=99
|
||||
augroup end
|
8
vim/rc.d/91.override-directus.vim
Normal file
8
vim/rc.d/91.override-directus.vim
Normal file
@ -0,0 +1,8 @@
|
||||
augroup directus
|
||||
autocmd!
|
||||
autocmd BufRead,BufEnter,BufNewFile */Projects/directus/*.js setlocal noexpandtab
|
||||
autocmd BufRead,BufEnter,BufNewFile */Projects/directus/*.mjs setlocal noexpandtab
|
||||
autocmd BufRead,BufEnter,BufNewFile */Projects/directus/*.ts setlocal noexpandtab
|
||||
|
||||
autocmd BufRead,BufNewFile */Projects/directus/cloud/code/scwrypts/* let b:scwryptsAutoName = "directus " . b:scwryptsAutoName
|
||||
augroup end
|
Reference in New Issue
Block a user