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.

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