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.

574 lines
17 KiB

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