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.

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