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.

572 lines
17 KiB

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