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.

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