Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

608 lines
19 KiB

5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
6 years ago
6 years ago
5 years ago
7 years ago
5 years ago
4 years ago
4 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
6 years ago
5 years ago
4 years ago
6 years ago
5 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
4 years ago
5 years ago
5 years ago
5 years ago
  1. " set x=y [[[ "
  2. set autoindent
  3. set autoread
  4. set background=dark
  5. " set colorcolumn=80
  6. set clipboard+=unnamedplus
  7. set diffopt=filler,context:3
  8. if has('nvim-0.3.2') || has("patch-8.1.0360")
  9. set diffopt=filler,internal,algorithm:histogram,indent-heuristic
  10. endif
  11. set encoding=utf-8
  12. set expandtab
  13. " set foldmethod=indent
  14. set foldmethod=marker
  15. set hlsearch
  16. " set ignorecase
  17. set linebreak
  18. set linespace=5
  19. set mouse=a
  20. " set mouse=c
  21. " set noswapfile
  22. set relativenumber
  23. set shiftwidth=4
  24. set smartcase
  25. set tabstop=4
  26. " set t_Co=256
  27. " set termguicolors
  28. " set timeoutlen=350
  29. set timeoutlen=200
  30. " set tw=75
  31. " set tw=70
  32. set tw=60
  33. set undodir=~/.vim/undo
  34. set undofile
  35. " set updatetime=1000
  36. " set updatetime=500
  37. set updatetime=0
  38. autocmd VimResized * wincmd =
  39. filetype plugin on
  40. filetype indent on
  41. syntax on
  42. autocmd CursorHold * if !bufexists("[Command Line]") | checktime | endif
  43. " cursor indicator [[[ "
  44. " set listchars=tab:\|\
  45. " set list
  46. " set cursorcolumn
  47. " set cursorline
  48. " ]]] cursor indicator "
  49. " ]]] set x=y "
  50. " commands for file types [[[ "
  51. autocmd BufNewFile,BufRead .* set syntax=sh
  52. autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
  53. autocmd FileType *css,gitcommit,haskell,htmldjango,html,javascript,json,lisp,markdown,
  54. \racket,tex,text,yaml set tabstop=2 shiftwidth=2
  55. " autocmd BufNewFile,BufRead *.md set filetype=markdown
  56. " autocmd Filetype markdown set textwidth=0
  57. " autocmd Filetype html set foldmarker=0
  58. autocmd BufNewFile,BufRead *.gd set expandtab!
  59. autocmd Filetype go set expandtab! sw=4
  60. " autocmd FileType go,groovy,html,java,javascript,Jenkinsfile,python,lua set fdm=indent
  61. autocmd FileType go,groovy,html,java,javascript,python,lua set fdm=indent
  62. autocmd Filetype markdown let g:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''", "*":"*"}
  63. " autocmd Filetype markdown map <F8> :LivedownToggle<CR>
  64. autocmd Filetype markdown map <F8> :InstantMarkdownPreview<CR>
  65. autocmd Filetype markdown map <F9> :InstantMarkdownStop<CR>:InstantMarkdownPreview<CR>
  66. autocmd Filetype markdown nnoremap <Tab> <Esc>>>A
  67. autocmd Filetype markdown inoremap <S-Tab> <Esc><<A
  68. autocmd Filetype markdown inoremap < <Esc><<A
  69. autocmd Filetype markdown inoremap << <
  70. autocmd Filetype markdown inoremap > <Esc>>>A
  71. autocmd Filetype markdown inoremap >> >
  72. " autocmd Filetype markdown set commentstring=<!---\ %s\ -->
  73. " format options [[[ "
  74. " a = auto-format paragraphs
  75. " c = wrap comments
  76. " j = remove comment header when joining lines
  77. " M = don't add space when joining lines
  78. " q = format comments with gq
  79. " t = wrap lines
  80. " v = break lines in insert
  81. " w = whitespace continues paragraph
  82. " ]]] format options "
  83. " autocmd FileType markdown,tex,text set spell spelllang=en_us formatoptions=acjMqtvw
  84. autocmd FileType markdown,tex,text set spell spelllang=en_us formatoptions=cjMqtvw
  85. autocmd Filetype json nnoremap <leader>j :%!python -m json.tool<CR>
  86. autocmd Filetype json set foldmethod=marker
  87. autocmd Filetype racket set commentstring=;%s;
  88. autocmd Filetype racket let g:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"}
  89. autocmd FileType sh map <F8> :!clear && shellcheck %<CR>
  90. autocmd Filetype taskdata set tw=0
  91. autocmd FileType tex set updatetime=1000 timeoutlen=300
  92. autocmd FileType tex map <F8> :VimtexCompile<CR>
  93. autocmd VimEnter *.tex VimtexCompile
  94. autocmd VimLeave *.tex !tex-clean %:p
  95. autocmd BufNewFile,BufRead *.tmpl set tw=0 sw=2 ft=go-template fmr=[[[,]]]
  96. " " auto-reload vimrc [[[ "
  97. " augroup myvimrc
  98. " au!
  99. " au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
  100. " augroup END
  101. " " ]]] auto-reload vimrc "
  102. " ]]] commands for file types "
  103. " commands for specific files [[[ "
  104. autocmd BufNewFile,BufRead watson*.fish set tabstop=2 shiftwidth=2 expandtab
  105. autocmd BufWritePost config.def.h silent !cd %:p:h; sudo rm config.h; sudo bear make install
  106. " autocmd BufRead config.def.h map <F8> :silent !cd %:p:h; sudo rm config.h; sudo bear make install<CR>
  107. autocmd BufRead config.def.h map <F10> :silent !cd %:p:h<CR>:!sudo rm config.h; sudo bear make install<CR>
  108. autocmd BufRead config.def.h set updatetime=3000
  109. autocmd BufRead commit-msg.txt set filetype=gitcommit tw=72
  110. autocmd VimLeave /etc/default/grub !sudo grub-mkconfig -o /boot/grub/grub.cfg
  111. " autocmd BufWritePost key_* !sync-shortcuts
  112. autocmd BufNewFile,BufRead key_* map <F1> :w<CR>:silent !sync-shortcuts<CR>
  113. " map <F1> :silent !scp %:p k@192.168.0.17:/home/k/a1<CR>
  114. " map <F2> :silent !scp -P 2222 e1.html e1_style.css kevin@127.0.0.1:/home/kevin/Downloads/e1<CR>
  115. " map <F6> :make -C ~/Documents/resume cv<CR>
  116. " ]]] commands for specific files "
  117. " vim-plug [[[
  118. " plug auto-install
  119. if empty(glob('~/.vim/autoload/plug.vim'))
  120. silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  121. \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  122. autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  123. endif
  124. call plug#begin('~/.vim/plugged')
  125. " prequisite for other plugins
  126. Plug 'vim-scripts/L9'
  127. " find files from within Vim
  128. " Plug 'vim-scripts/FuzzyFinder'
  129. {{ if not .gui }}
  130. " Gotham color scheme
  131. Plug 'whatyouhide/vim-gotham'
  132. {{ end }}
  133. " " collection of Vim color schemes
  134. " Plug 'flazz/vim-colorschemes'
  135. " " preview Vim color scheme easily within Vim
  136. " Plug 'xolox/vim-colorscheme-switcher'
  137. " " prerequisite for above plugin
  138. " Plug 'xolox/vim-misc'
  139. " automatically save buffers upon returning to normal mode
  140. Plug '907th/vim-auto-save'
  141. let g:auto_save = 1
  142. " let g:auto_save_events = ["CursorHold", "CursorHoldI"]
  143. let g:auto_save_events = ["CursorHold"]
  144. " autocmd VimEnter *.tex let g:auto_save = 0
  145. " provides various functionality for writing LaTeX in Vim
  146. Plug 'lervag/vimtex'
  147. " au BufWritePost *.tex silent call Tex_RunLaTeX()
  148. au BufWritePost *.tex silent !pkill -USR1 xdvi.bin
  149. let g:Tex_MultipleCompileFormats = 'dvi,pdf'
  150. let g:vimtex_view_general_viewer = 'evince'
  151. let g:vimtex_quickfix_latexlog = {
  152. \ 'overfull' : 0,
  153. \ 'underfull' : 0,
  154. \ 'global' : 0,
  155. \ 'packages' : {
  156. \ 'biblatex' : 0,
  157. \ 'gensymb' : 0,
  158. \ },
  159. \ 'references' : 0,
  160. \ 'unused' : 0,
  161. \}
  162. let g:vimtex_quickfix_autoclose_after_keystrokes = 5
  163. " let g:vimtex_compiler_latexmk = {
  164. " \ 'continuous' : 0,
  165. " \}
  166. {{ if not (eq .chezmoi.username "root") }}
  167. " auto-completion for various languages
  168. Plug 'Valloric/YouCompleteMe'
  169. let g:ycm_filetype_blacklist = {
  170. \ 'tagbar': 1,
  171. \ 'qf': 1,
  172. \ 'notes': 1,
  173. \ 'unite': 1,
  174. \ 'vimwiki': 1,
  175. \ 'pandoc': 1,
  176. \ 'infolog': 1,
  177. \ 'mail': 1
  178. \}
  179. {{ end }}
  180. " wrote short bits of text that expand into whatever you want
  181. " demo: https://www.youtube.com/watch?v=Zik6u0klD40
  182. Plug 'SirVer/ultisnips'
  183. " better key bindings for UltiSnipsExpandTrigger
  184. let g:UltiSnipsExpandTrigger = "<tab>"
  185. let g:UltiSnipsJumpForwardTrigger = "<tab>"
  186. let g:UltiSnipsJumpBackwardTrigger = "<C-tab>"
  187. let g:ultisnips_javascript = {
  188. \ 'keyword-spacing': 'always',
  189. \ 'semi': 'never',
  190. \ 'space-before-function-paren': 'never',
  191. \ }
  192. " custom snippets
  193. Plug 'Kevin-Mok/vim-snippets'
  194. " to make YouCompleteMe work with UltiSnips (both use Tab)
  195. Plug 'ervandew/supertab'
  196. " make YCM compatible with UltiSnips (using supertab)
  197. let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
  198. let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
  199. let g:SuperTabDefaultCompletionType = '<C-n>'
  200. " easily comment/uncomment lines
  201. Plug 'scrooloose/nerdcommenter'
  202. let g:NERDTrimTrailingWhitespace = 1
  203. let g:NERDSpaceDelims = 1
  204. " add quotes/brackets around chunks of text easily
  205. Plug 'tpope/vim-surround'
  206. nmap S ys
  207. " navigate around file easily and precisely
  208. Plug 'easymotion/vim-easymotion'
  209. map <Space> <Plug>(easymotion-prefix)
  210. " status bar displaying various info about the current buffer
  211. Plug 'vim-airline/vim-airline'
  212. let g:airline_section_c = '%F'
  213. Plug 'vim-airline/vim-airline-themes'
  214. let g:airline_powerline_fonts = 1
  215. " continue Markdown lists when started
  216. Plug 'dkarter/bullets.vim'
  217. " coordinate Vim color scheme with terminal color scheme
  218. Plug 'dylanaraps/wal.vim'
  219. " repeat plugin commands
  220. Plug 'tpope/vim-repeat'
  221. " better Django support
  222. Plug 'tweekmonster/django-plus.vim'
  223. " auto-close brackets
  224. Plug 'jiangmiao/auto-pairs'
  225. let g:AutoPairsMapSpace = 0
  226. Plug 'henrik/vim-indexed-search'
  227. Plug 'PotatoesMaster/i3-vim-syntax'
  228. " vim file explorer
  229. Plug 'terryma/vim-multiple-cursors'
  230. " let g:multi_cursor_select_all_word_key='<C-a>'
  231. let g:multi_cursor_exit_from_visual_mode=0
  232. let g:multi_cursor_exit_from_insert_mode=0
  233. Plug 'dag/vim-fish'
  234. " live preview Markdown"
  235. " Plug 'shime/vim-livedown'
  236. " Plug 'suan/vim-instant-markdown', {'for': 'markdown'}
  237. " let g:instant_markdown_autostart = 0
  238. " let g:instant_markdown_port = 8888
  239. " Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
  240. " let g:mkdp_auto_start = 1
  241. " let g:mkdp_browser = 'firefox'
  242. " let g:mkdp_echo_preview_url = 1
  243. " git helper
  244. Plug 'tpope/vim-fugitive'
  245. " auto reload file
  246. Plug 'djoshea/vim-autoread'
  247. " Plug 'mustache/vim-mustache-handlebars'
  248. " Plug 'trapd00r/vim-syntax-vidir-ls'
  249. Plug 'calviken/vim-gdscript3'
  250. " display hex colors in Vim
  251. " Plug 'RRethy/vim-hexokinase'
  252. Plug 'junegunn/goyo.vim'
  253. " prevent commands being executed through modelines "
  254. Plug 'ciaranm/securemodelines/'
  255. " different colors for each layer of surrounding brackets
  256. Plug 'luochen1990/rainbow'
  257. let g:rainbow_active = 1
  258. " easy custom text objects
  259. Plug 'kana/vim-textobj-user'
  260. " latex custom text objects
  261. Plug 'rbonvall/vim-textobj-latex'
  262. " swap words
  263. Plug 'tommcdo/vim-exchange'
  264. " Plug 'scrooloose/nerdtree'
  265. " let NERDTreeQuitOnOpen=1
  266. " let NERDTreeShowHidden=1
  267. " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  268. " Plug 'junegunn/fzf.vim'
  269. Plug 'christoomey/vim-tmux-navigator'
  270. " mappings [[[ "
  271. let g:tmux_navigator_no_mappings = 1
  272. nnoremap <A-j> :TmuxNavigateDown<cr>
  273. nnoremap <A-k> :TmuxNavigateUp<cr>
  274. nnoremap <A-h> :TmuxNavigateLeft<cr>
  275. nnoremap <A-l> :TmuxNavigateRight<cr>
  276. " nnoremap <C-Down> :TmuxNavigateDown<cr>
  277. " nnoremap <C-Up> :TmuxNavigateUp<cr>
  278. " nnoremap <C-Left> :TmuxNavigateLeft<cr>
  279. " nnoremap <C-Right> :TmuxNavigateRight<cr>
  280. " ]]] mappings "
  281. " highlight multiple words
  282. " TODO: mapping conflicts "
  283. " Plug 'inkarkat/vim-mark'
  284. " Plug 'jceb/vim-orgmode'
  285. " let g:org_todo_keywords=['TODO', 'STARTED', '|', 'DONE']
  286. Plug 'junegunn/vim-easy-align'
  287. " Start interactive EasyAlign in visual mode (e.g. vipga)
  288. xmap ga <Plug>(EasyAlign)
  289. " Start interactive EasyAlign for a motion/text object (e.g. gaip)
  290. nmap ga <Plug>(EasyAlign)
  291. Plug 'wlangstroth/vim-racket'
  292. Plug 'neovimhaskell/haskell-vim'
  293. Plug 'masukomi/vim-markdown-folding'
  294. autocmd FileType markdown set foldexpr=NestedMarkdownFolds()
  295. Plug 'cespare/vim-toml'
  296. Plug 'dpelle/vim-LanguageTool'
  297. " increment dates with C-a
  298. Plug 'tpope/vim-speeddating'
  299. Plug 'martinda/Jenkinsfile-vim-syntax'
  300. " ]]] vim-plug "
  301. " Mappings [[[ "
  302. call plug#end()
  303. {{ if .gui }}
  304. colorscheme wal
  305. {{ else }}
  306. colorscheme gotham256
  307. {{ end }}
  308. " normal mappings [[[ "
  309. nnoremap <ScrollWheelUp> <C-U>
  310. nnoremap <ScrollWheelDown> <C-D>
  311. " visual select across lines by default "
  312. nnoremap v <C-V>
  313. " last macro "
  314. nnoremap Q @@
  315. " toggle fold "
  316. nnoremap , za
  317. " jump to horizontal position for mark "
  318. nnoremap ' `
  319. " indenting
  320. nnoremap > >>
  321. nnoremap < <<
  322. inoremap << <Esc><<A
  323. " ]]] normal mappings "
  324. " leader mappings [[[ "
  325. let mapleader="\<Space>"
  326. " find alias
  327. nnoremap <leader>a /^ <Left>
  328. nnoremap <leader>ac :.s/\(\w\w\)/\u\1\U\2/g<CR>
  329. " replace until end of line
  330. nnoremap <leader>c c$
  331. " delete until end of line
  332. nnoremap <leader>d d$
  333. " delete entire buffer
  334. nnoremap <leader>dg ggdG
  335. " delete entire line
  336. nnoremap <leader>dl 0d$
  337. " delete lines matching pattern
  338. nnoremap <leader>dls :g//d<left><left>
  339. " show docstring for cur word
  340. nnoremap <leader>do :YcmCompleter GetDoc<CR>
  341. " delete line into system clipboard
  342. nnoremap <leader>D "+dd
  343. " delete entire buffer into system clipboard
  344. nnoremap <leader>DA "+ggdG
  345. " find copied text
  346. nnoremap <leader>f q/p<CR>
  347. " find merge conflicts
  348. nnoremap <leader>fc /[<>=\|]\{7\}<CR>
  349. " reload folds
  350. nnoremap <leader>fmi :set foldmethod=indent<CR> zM
  351. nnoremap <leader>fmm :set foldmethod=marker<CR> zM
  352. " add marker foldmethod modeline
  353. nnoremap <leader>fi :YcmCompleter FixIt<CR>
  354. " check filetype
  355. nnoremap <leader>ft :se ft?<CR>
  356. " check todo's
  357. nnoremap <leader>ftd /TODO<CR>
  358. nnoremap <leader>g :YcmCompleter GoTo<CR>
  359. nnoremap <leader>gb <C-O>
  360. " vimdiff split
  361. nnoremap <leader>gd :Gvdiff
  362. nnoremap <leader>gdh :Gvdiff HEAD^
  363. nnoremap <leader>gdm :Gvdiff master<CR>
  364. " toggle search highlighting
  365. nnoremap <leader>h :set hlsearch! hlsearch?<CR>
  366. " help
  367. nnoremap <leader>he :vert help
  368. nnoremap <leader>ht :set tabstop=2 shiftwidth=2 expandtab<CR>
  369. nnoremap <leader>vhe :vert help
  370. " don't add space when joining lines "
  371. nnoremap <leader>j gJ
  372. " join all paragraphs into single line "
  373. nnoremap <leader>jl :set tw=9999999<CR>gggqG
  374. " format current line
  375. nnoremap <leader>l Vgq
  376. " format this and next line
  377. nnoremap <leader>ll Vjgq
  378. " move cursor to middle of line
  379. " nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
  380. nnoremap <leader>m :vert Man
  381. " apply normal command to selection
  382. vnoremap <leader>n q:anorm
  383. " turn off autoformat"
  384. nnoremap <leader>na :set spell spelllang=en_us formatoptions=cjMqtvw<CR>
  385. nnoremap <leader>nt :NERDTree<CR>
  386. " check if in neovim
  387. nnoremap <leader>nv :echo has('nvim')<CR>
  388. " don't wrap lines
  389. nnoremap <leader>nw :set nowrap<CR>
  390. " recursively open fold
  391. nnoremap <leader>o zO
  392. " paste from?
  393. " nnoremap <leader>p "*p
  394. " format paragraph
  395. nnoremap <leader>p gqip
  396. " Plug commands
  397. nnoremap <leader>pli :PlugInstall<CR>
  398. nnoremap <leader>plc :PlugClean<CR>
  399. nnoremap <leader>plu :PlugUpdate<CR>
  400. " don't break lines
  401. nnoremap <leader>py :set tw=0<CR>
  402. " replace in next x lines
  403. " nnoremap <leader>r q:i.,.+s///g<ESC>Fsi
  404. " replace in line
  405. nnoremap <leader>r q:i.s///g<left><left><left>
  406. " replace in visual selection
  407. vnoremap <leader>r q:is///g<ESC>3ha
  408. " replace in entire file
  409. " nnoremap <leader>R q:i%s///g<ESC>2F/i
  410. nnoremap <leader>ra q:i%s///g<ESC>2F/i
  411. " remove italics tags
  412. nnoremap <leader>rmi :%s/<\/\?i>//g<CR>
  413. nnoremap <leader>rs :res
  414. " reload vim config
  415. nnoremap <leader>rv :source $MYVIMRC<CR>
  416. vnoremap <leader>s :sort<CR>
  417. nnoremap <leader>sc :set spell spelllang=en_us<CR>
  418. " run current file in shell
  419. nnoremap <leader>sh :!%:p
  420. " sort lines until end of file
  421. nnoremap <leader>so q:i.,$sort<CR>
  422. " vertical split "
  423. nnoremap <leader>sp :sp
  424. " sort lines
  425. nnoremap <leader>sol q:i.,.+sort<ESC>Fsi
  426. " set syntax to shell (for dotfiles)
  427. nnoremap <leader>sys :set syn=sh<CR>
  428. vnoremap <leader>t :!tac<CR>
  429. " capitalize letter
  430. nnoremap <leader>u vU
  431. " comment visual block
  432. " nnoremap <leader>vcc V<leader>cc
  433. " uncomment visual block
  434. " nnoremap <leader>vcu V<leader>cu
  435. " horizontal split "
  436. nnoremap <leader>vs :vs
  437. " open vimrc in vertical split
  438. nnoremap <leader>vv :vsp ~/.vimrc<CR>
  439. " copy next thing to system clipboard
  440. " nnoremap <leader>y "+
  441. " nnoremap <leader>Y "+Y
  442. nnoremap <leader>y y$
  443. nnoremap <leader>yo :Goyo<CR>
  444. " yank entire buffer
  445. nnoremap <leader>yg ggyG
  446. " toggle fold
  447. nnoremap <leader>z za
  448. " close all folds
  449. nnoremap <leader>zm zM
  450. " open all folds
  451. nnoremap <leader>zr zR
  452. " ]]] leader mappings "
  453. " function keys [[[ "
  454. map <F3> :wa<CR>
  455. map <F4> :xa<CR>
  456. map <F5> :q!<CR>
  457. map <F6> :qa!<CR>
  458. map <F7> :AutoSaveToggle<CR>
  459. " reload file
  460. nnoremap <F9> :e<CR>
  461. nnoremap <F10> :set paste<CR>"+p:set nopaste<CR>
  462. nnoremap <F11> :set paste<CR>"*p:set nopaste<CR>
  463. " ]]] function keys "
  464. map <S-Enter> O<ESC>
  465. " swap text visually
  466. vnoremap <C-P> <Esc>`.``gvP``P
  467. ino <C-A> <C-O>yiW<End>=<C-R>=<C-R>0<CR>
  468. " splits [[[ "
  469. nnoremap <C-Down> <C-W><C-J>
  470. nnoremap <C-Up> <C-W><C-K>
  471. nnoremap <C-Right> <C-W><C-L>
  472. nnoremap <C-Left> <C-W><C-H>
  473. " Maximize height/width.
  474. nnoremap <C-g> <C-W>_
  475. nnoremap <C-w> <C-W>|
  476. " ]]] splits "
  477. " ]]] Mappings "
  478. " Local Mappings [[[ "
  479. let maplocalleader="\\"
  480. " tex [[[ "
  481. autocmd Filetype tex inoremap <localleader>bt \bowtie
  482. autocmd Filetype tex inoremap <localleader>c \checkmark
  483. autocmd Filetype tex inoremap <localleader>d \delta
  484. autocmd Filetype tex inoremap <localleader>D \Delta
  485. autocmd Filetype tex inoremap <localleader>e \exists
  486. autocmd Filetype tex inoremap <localleader>ep \epsilon
  487. autocmd Filetype tex inoremap <localleader>fa \forall
  488. autocmd Filetype tex inoremap <localleader>g \geq
  489. autocmd Filetype tex inoremap <localleader>i \in
  490. autocmd Filetype tex inoremap <localleader>la \leftarrow
  491. autocmd Filetype tex inoremap <localleader>le \leq
  492. autocmd Filetype tex inoremap <localleader>ln \log n
  493. autocmd Filetype tex inoremap <localleader>lr \Leftrightarrow
  494. " autocmd Filetype tex inoremap <localleader>n \neg
  495. autocmd Filetype tex inoremap <localleader>n \neq
  496. autocmd Filetype tex inoremap <localleader>N \mathbb{N}
  497. autocmd Filetype tex inoremap <localleader>pg \pagebreak<Enter>
  498. autocmd Filetype tex inoremap <localleader>ph [,phantom]
  499. autocmd Filetype tex inoremap <localleader>q \qquad
  500. autocmd Filetype tex inoremap <localleader>r \rightarrow
  501. autocmd Filetype tex inoremap <localleader>R \Rightarrow
  502. autocmd Filetype tex inoremap <localleader>s \subset
  503. autocmd Filetype tex inoremap <localleader>st such that
  504. autocmd Filetype tex inoremap <localleader>S \Sigma
  505. autocmd Filetype tex inoremap <localleader>t \times
  506. " autocmd Filetype tex inoremap <localleader>T $T$
  507. autocmd Filetype tex inoremap <localleader>T \Theta
  508. " replace bars/underscores in URL
  509. autocmd Filetype tex inoremap <localleader>url :.s/\([-_]\)/\\\1/g<CR>
  510. autocmd Filetype tex inoremap <localleader>v \vee
  511. autocmd Filetype tex inoremap <localleader>w \wedge
  512. autocmd Filetype tex inoremap <localleader>x $x$-axis
  513. autocmd Filetype tex inoremap <localleader>y $y$-axis
  514. autocmd Filetype tex inoremap <localleader>Z \mathbb{Z}
  515. " par3
  516. autocmd Filetype tex inoremap <localleader>wx $w(x)$
  517. autocmd Filetype tex inoremap <localleader>tx $t(x)$
  518. " ]]] tex "
  519. autocmd Filetype c inoremap <localleader>uc unsigned char
  520. autocmd BufNewFile,BufRead *.h nnoremap <localleader>x 0iextern <Esc>f{hc$;<Esc>
  521. autocmd BufNewFile,BufRead ~/.habitctl/log nnoremap <localleader>d Gy3kGp5e<C-V>3j<C-a>$rnj.j.j$.
  522. autocmd BufNewFile,BufRead ~/.habitctl/log nnoremap <localleader>n $rn
  523. autocmd BufNewFile,BufRead ~/.habitctl/log nnoremap <localleader>y $ry
  524. autocmd Filetype fish inoremap <localleader>1 $argv[1]
  525. autocmd Filetype fish inoremap <localleader>2 $argv[2]
  526. autocmd Filetype javascript inoremap <localleader>x process.exit()
  527. autocmd Filetype markdown inoremap <localleader>c - [ ]
  528. autocmd Filetype markdown nnoremap <localleader>x 0f[lrx
  529. " nnoremap <localleader>x 0f[lrx
  530. autocmd Filetype go-template inoremap <localleader>e {{"{{ else }}"}}
  531. autocmd Filetype go-template inoremap <localleader>hd {{"{{ .chezmoi.homedir }}"}}
  532. autocmd Filetype go-template nnoremap <localleader>fp :%s/{{"{{{"}}/[[[/g<CR>:%s/}}}/]]]/g<CR>
  533. autocmd Filetype python inoremap <localleader>bp breakpoint()
  534. autocmd Filetype python inoremap <localleader>s self.
  535. " ]]] Local Mappings "
  536. " vim: fdm=marker ft=vim.go-template