Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " -----------------------------------------------------------------------------
- " File : .vim/贵阳开发票
- " Author : 贵阳开发票▌薇同电▌【159乄1415乄8529】联系:σσ:【5999乄87798】-开各种真发票.哪里有开发票广告、酒店住宿、餐饮、机械设备、服务、建筑、租赁、建材、劳务、办公用品、咨询、材料、工程款、会议.统一国税网查询 , 合作共赢。 Sam Erickson | https://pastebin.com/NN0EQttb
- " Last updated : Oct. 20th, 2018
- " -----------------------------------------------------------------------------
- "Sets the text width to 80 characters and highlights characters over that limit
- set textwidth=80
- " Add color column to the lines that go over 80 characters
- call matchadd('ColorColumn', '\%82v', 100 )
- " Highlights all characters after the line 80
- match ErrorMsg '\%>81v.\+'
- let mapleader = ","
- " Set the character for list
- set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:·
- set formatoptions=qcn1jo
- " Set indenting and tab rules
- set autoindent
- set smartindent
- set wildmenu
- set tabstop=2
- set nowrap
- set shiftwidth=2
- set softtabstop=2
- set expandtab
- set backup
- set noswapfile
- set undodir=~/.vim/tmp/undo// " undo files
- set backupdir=~/.vim/tmp/backup// " backups
- set directory=~/.vim/tmp/swap// " swap files
- " Make those folders automatically if they don't already exist.
- if !isdirectory(expand(&undodir))
- call mkdir(expand(&undodir), "p")
- endif
- if !isdirectory(expand(&backupdir))
- call mkdir(expand(&backupdir), "p")
- endif
- if !isdirectory(expand(&directory))
- call mkdir(expand(&directory), "p")
- endif
- " Wild menu settings
- set wildmode=list:longest
- set wildignore+=.hg,.git,.svn " Version control
- set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
- set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
- set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
- set wildignore+=*.spl " compiled spelling word lists
- set wildignore+=*.sw? " Vim swap files
- set wildignore+=*.DS_Store " OSX bullshit
- set wildignore+=*.luac " Lua byte code
- set wildignore+=migrations " Django migrations
- set wildignore+=*.pyc " Python byte code
- set wildignore+=*.orig " Merge resolution files
- set wildignore+=*.fasl " Lisp FASLs
- set wildignore+=*.dx64fsl " CCL
- " Allowes language specific vim setting by placing a file in ftplugin/
- " e.g to edit the settings for html files create a file
- " ~/.vim/ftplugin/html.vim and add the rules to that file.
- filetype plugin indent on
- " Make table mode markdown compatible
- let g:table_mode_corner='|'
- syntax on
- " LATEX SETTINGS
- " Sets the frequency the pdf get updated
- au Filetype tex setl updatetime=1
- " Set the pdf viewing app
- let g:livepreview_previewer = 'open -a Preview'
- " Using grip for github flavoured markdown preview
- let vim_markdown_preview_github=1
- " Runs a script that cleans out tex build files
- " whenever I close out of a .tex file.
- au VimLeave *.tex !texclear %
- " -----------------------------------------------------------------------------
- " KEYBINDINGS
- " -----------------------------------------------------------------------------
- " C-T for new tab
- nnoremap <C-t> :tabnew<cr>
- " GRAMMEROUS KEYBINDINGS
- nnoremap ;gg :GrammarousCheck<CR>
- nnoremap ;gm <Plug>(grammarous-move-to-info-window)
- " Makes backspace work correctly
- set backspace=indent,eol,start
- map <F4> :setlocal number!<CR>
- "Remove all trailing whitespace by pressing F5
- nnoremap ;t :TableModeEnable<CR>
- " Save using ;s
- nnoremap ;s :w<CR>
- " Environment changing keybindings
- nnoremap ;ss :setlocal spell!<CR>
- nnoremap ;n :setlocal number! relativenumber!<CR>
- nnoremap ;w :set list!<CR>
- nnoremap ;p :LLPStartPreview<CR>
- nnoremap ;g :Goyo<CR>
- inoremap ;ss <Esc>:setlocal spell!<CR>i
- inoremap ;n <Esc>:setlocal number! relativenumber!<CR>i
- inoremap ;w <Esc>:set list!<CR>i
- inoremap ;p <Esc>:LLPStartPreview<CR>i
- inoremap ;g <esc>:Goyo<CR>i
- " Yank to end of line
- nnoremap Y y$
- " Change split window keybindings to be faster
- map <C-h> <C-w>h
- map <C-j> <C-w>j
- map <C-k> <C-w>k
- map <C-l> <C-w>l
- " Toggle ruler at line 80
- command! ToggleCC :let &cc = &cc == '' ? '81' : ''
- " Removes all trailing whitespaces
- noremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
- " Show a ruler on line 81
- noremap <F9> :let &cc = &cc == '' ? '81' : ''<CR>
- " Use jk instead of ESC
- inoremap jk <ESC>
- " Make move to the end of the line better
- nnoremap 0 $
- nnoremap 9 0
- " Add a banner to a config file
- inoremap ;b <Esc>:r ~/.vim/banners/main.txt<CR>
- " Navigating with guides
- inoremap ;l <Esc>/<++><Enter>"_c4l
- vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- " map <space><tab> <Esc>/<++><Enter>"_c4l
- " Use // and __ to turn on and off table mode while in insert mode
- function! s:isAtStartOfLine(mapping)
- let text_before_cursor = getline('.')[0 : col('.')-1]
- let mapping_pattern = '\V' . escape(a:mapping, '\')
- let comment_pattern = '\V'
- \. escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
- return (text_before_cursor =~? '^'
- \. ('\v(' . comment_pattern . '\v)?')
- \. '\s*\v' . mapping_pattern . '\v$')
- endfunction
- inoreabbrev <expr> <bar><bar>
- \ <SID>isAtStartOfLine('\|\|') ?
- \ '<c-o>:TableModeEnable<cr><bar><space><bar><left><left>' : '<bar><bar>'
- inoreabbrev <expr> __
- \ <SID>isAtStartOfLine('__') ?
- \ '<c-o>:silent! TableModeDisable<cr>' : '__'
- " -----------------------------------------------------------------------------
- " QUICK EDITING
- " -----------------------------------------------------------------------------
- nnoremap <leader>ve :tabnew ~/.vim/vimrc<CR>
- nnoremap <leader>ae :tabnew ~/.config/zsh/user_aliases<CR>
- nnoremap <leader>ch :tabnew ~/.chunkwmrc<CR>
- nnoremap <leader>sk :tabnew ~/.skhdrc<CR>
- nnoremap <leader>zs :tabnew ~/.zshrc<CR>
- " -----------------------------------------------------------------------------
- " PLUGINS
- " -----------------------------------------------------------------------------
- set nocompatible " be iMproved, required
- filetype off " required
- " set the runtime path to include Vundle and initialize
- set rtp+=~/.vim/bundle/Vundle.vim
- call vundle#begin()
- " let Vundle manage Vundle, required
- Plugin 'VundleVim/Vundle.vim'
- " A Plugin for distraction free writting in vim
- Plugin 'junegunn/goyo.vim'
- " A Vim Plugin for Lively Previewing LaTeX PDF Output
- Plugin 'xuhdev/vim-latex-live-preview'
- Plugin 'itchyny/lightline.vim'
- Plugin 'dhruvasagar/vim-table-mode'
- " Work with pywal
- Plugin 'dylanaraps/wal.vim'
- " Add grammar checking
- Plugin 'rhysd/vim-grammarous'
- call vundle#end() " required
- filetype plugin indent on " required
- " -----------------------------------------------------------------------------
- " STATUS BAR
- " -----------------------------------------------------------------------------
- " Makes the status bar look nice
- set laststatus=2
- let g:lightline = {
- \ 'colorscheme': 'wombat',
- \ 'active': {
- \ 'left': [ [ 'mode', 'paste' ],
- \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
- \ },
- \ 'component_function': {
- \ 'gitbranch': 'fugitive#head'
- \ },
- \ }
- " -----------------------------------------------------------------------------
- " ABBRIVIATIONS
- " -----------------------------------------------------------------------------
- " Short cuts
- abbr memail me@samerickson.xyz<Esc>A
- abbr sweb https://samerickson.xyz<Esc>A
- abbr gls https://gitlab.com/samericksn<Esc>A
- abbr se Sam Erickson<Esc>A
- " Common spelling mistakes
- abbr ehco echo<Esc>A
- " -----------------------------------------------------------------------------
- " Additional settings that need to be at the end of the file
- " -----------------------------------------------------------------------------
- colorscheme wal
- " -----------------------------------------------------------------------------
- " HEADERS
- " -----------------------------------------------------------------------------
- au Filetype html nnoremap ;h :0r ~/.vim/headers/html.txt<CR>
- au Filetype sh nnoremap ;h :0r ~/.vim/headers/script.txt<CR>
- au Filetype vim nnoremap ;h :0r ~/.vim/headers/vim.txt<CR>
- au Filetype cpp nnoremap ;h :0r ~/.vim/headers/cpp.txt<CR>
- au Filetype javascript nnoremap ;h :0r ~/.vim/headers/js.txt<CR>
- au Filetype css nnoremap ;h :0r ~/.vim/headers/css.txt<CR>
- au Filetype tex nnoremap ;h :0r ~/.vim/headers/latex.txt<CR>
- au Filetype markdown nnoremap ;h :0r ~/.vim/headers/markdown.txt<CR>
- " -----------------------------------------------------------------------------
- " VIMFILE SNIPPETS
- " -----------------------------------------------------------------------------
- " Commenting current line
- au Filetype vim nnoremap ;c :s!^!" !<CR>
- au Filetype vim nnoremap ;u :s!^" !!<CR>
- au Filetype vim inoremap ;c <Esc>:s!^!" !<CR>A
- au Filetype vim inoremap ;u <Esc>:s!^" !!<CR>A
- " ----------------------------------------------------------------------------
- " MARKDOWN SNIPPETS
- " -----------------------------------------------------------------------------
- au Filetype markdown inoremap ,n ---<Enter><Enter>
- au Filetype markdown inoremap ,b ****<++><Esc>F*hi
- au Filetype markdown inoremap ,s ~~~~<++><Esc>F~hi
- au Filetype markdown inoremap ,e **<++><Esc>F*i
- au Filetype markdown inoremap ,h ====<Space><++><Esc>F=hi
- au Filetype markdown inoremap ,i ![](<++>)<++><Esc>F[a
- au Filetype markdown inoremap ,a [](<++>)<++><Esc>F[a
- au Filetype markdown inoremap ,1 #<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,2 ##<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,3 ###<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,l --------<Enter>
- au Filetype markdown inoremap ,c ```<CR><CR>```<CR><CR><++><Esc>3ki
- " For kmarkdown, while writting my blog
- au Filetype markdown inoremap
- \,h {% highlight %}<CR><++><CR>{% endhighlight %}<CR><CR><++><Esc>4k10li
- " -----------------------------------------------------------------------------
- " CPP SNIPPETS
- " -----------------------------------------------------------------------------
- " -----------------------------------------------------------------------------
- " CSS SNIPPETS
- " -----------------------------------------------------------------------------
- au Filetype css inoremap ;c /* */<++><Esc>7h
- au Filetype css nnoremap ;c :s/^\(.*\)$//* \1 *//<CR>
- " -----------------------------------------------------------------------------
- " HTML SNIPPETS
- " -----------------------------------------------------------------------------
- " Comments
- au Filetype html nnoremap ;u :s/^\(.*\)$/<!-- \1 -->/<CR>
- au Filetype html inoremap ;c <!-- --><CR><++><Esc>k2li
- " Header
- " Elements
- au Filetype html inoremap ,b <b></b><Space><++><Esc>FbT>i
- au Filetype html inoremap ,it <em></em><Space><++><Esc>FeT>i
- au Filetype html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
- au Filetype html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
- au Filetype html inoremap ,li <Esc>o<li></li><Esc>F>a
- au Filetype html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
- au Filetype html inoremap ,td <td></td><++><Esc>Fdcit
- au Filetype html inoremap ,tr <tr></tr><Enter><++><Esc>kf<i
- au Filetype html inoremap ,th <th></th><++><Esc>Fhcit
- au Filetype html inoremap ,tab <table><Enter></table><Esc>O
- au Filetype html inoremap ,dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
- au Filetype html inoremap ,dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
- au Filetype html inoremap ,e
- \<a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
- au Filetype html inoremap ,ul
- \<ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
- au Filetype html inoremap ,ol
- \<ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
- " -----------------------------------------------------------------------------
- " LATEX SNIPPETS
- " -----------------------------------------------------------------------------
- au FileType tex inoremap ,em \emph{}<++><Esc>T{i
- au FileType tex inoremap ,bf \textbf{}<++><Esc>T{i
- au FileType tex inoremap ,li <Enter>\item<Space>
- au FIleType tex inoremap ,n \linebreak<CR><CR>
- au FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space>
- " Fix markdown syntax when writting posts for my blog
- function! MathAndLiquid()
- "" Define certain regions
- " Block math. Look for "$$[anything]$$"
- syn region math start=/\$\$/ end=/\$\$/
- " inline math. Look for "$[not $][anything]$"
- syn match math_block '\$[^$].\{-}\$'
- " Liquid single line. Look for "{%[anything]%}"
- syn match liquid '{%.*%}'
- " Liquid multiline. Look for "{%[anything]%}[anything]{%[anything]%}"
- syn region highlight_block start='{% highlight .*%}' end='{%.*%}'
- " Fenced code blocks, used in GitHub Flavored Markdown (GFM)
- syn region highlight_block start='```' end='```'
- "" Actually highlight those regions.
- hi link math Statement
- hi link liquid Statement
- hi link highlight_block Function
- hi link math_block Function
- endfunction
- " Call everytime we open a Markdown file
- autocmd BufRead,BufNewFile,BufEnter *.md,*.markdown call MathAndLiquid()" -----------------------------------------------------------------------------
- " File : .贵阳/贵阳开发票
- " Author : 贵阳开发票▌薇同电▌【159乄1415乄8529】联系:σσ:【5999乄87798】-开各种真发票.哪里有开发票广告、酒店住宿、餐饮、机械设备、服务、建筑、租赁、建材、劳务、办公用品、咨询、材料、工程款、会议.统一国税网查询 , 合作共赢。 Sam Erickson | https://pastebin.com/NN0EQttb
- " Last updated : Oct. 20th, 2018
- " -----------------------------------------------------------------------------
- "Sets the text width to 80 characters and highlights characters over that limit
- set textwidth=80
- " Add color column to the lines that go over 80 characters
- call matchadd('ColorColumn', '\%82v', 100 )
- " Highlights all characters after the line 80
- match ErrorMsg '\%>81v.\+'
- let mapleader = ","
- " Set the character for list
- set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:·
- set formatoptions=qcn1jo
- " Set indenting and tab rules
- set autoindent
- set smartindent
- set wildmenu
- set tabstop=2
- set nowrap
- set shiftwidth=2
- set softtabstop=2
- set expandtab
- set backup
- set noswapfile
- set undodir=~/.vim/tmp/undo// " undo files
- set backupdir=~/.vim/tmp/backup// " backups
- set directory=~/.vim/tmp/swap// " swap files
- " Make those folders automatically if they don't already exist.
- if !isdirectory(expand(&undodir))
- call mkdir(expand(&undodir), "p")
- endif
- if !isdirectory(expand(&backupdir))
- call mkdir(expand(&backupdir), "p")
- endif
- if !isdirectory(expand(&directory))
- call mkdir(expand(&directory), "p")
- endif
- " Wild menu settings
- set wildmode=list:longest
- set wildignore+=.hg,.git,.svn " Version control
- set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
- set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
- set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
- set wildignore+=*.spl " compiled spelling word lists
- set wildignore+=*.sw? " Vim swap files
- set wildignore+=*.DS_Store " OSX bullshit
- set wildignore+=*.luac " Lua byte code
- set wildignore+=migrations " Django migrations
- set wildignore+=*.pyc " Python byte code
- set wildignore+=*.orig " Merge resolution files
- set wildignore+=*.fasl " Lisp FASLs
- set wildignore+=*.dx64fsl " CCL
- " Allowes language specific vim setting by placing a file in ftplugin/
- " e.g to edit the settings for html files create a file
- " ~/.vim/ftplugin/html.vim and add the rules to that file.
- filetype plugin indent on
- " Make table mode markdown compatible
- let g:table_mode_corner='|'
- syntax on
- " LATEX SETTINGS
- " Sets the frequency the pdf get updated
- au Filetype tex setl updatetime=1
- " Set the pdf viewing app
- let g:livepreview_previewer = 'open -a Preview'
- " Using grip for github flavoured markdown preview
- let vim_markdown_preview_github=1
- " Runs a script that cleans out tex build files
- " whenever I close out of a .tex file.
- au VimLeave *.tex !texclear %
- " -----------------------------------------------------------------------------
- " KEYBINDINGS
- " -----------------------------------------------------------------------------
- " C-T for new tab
- nnoremap <C-t> :tabnew<cr>
- " GRAMMEROUS KEYBINDINGS
- nnoremap ;gg :GrammarousCheck<CR>
- nnoremap ;gm <Plug>(grammarous-move-to-info-window)
- " Makes backspace work correctly
- set backspace=indent,eol,start
- map <F4> :setlocal number!<CR>
- "Remove all trailing whitespace by pressing F5
- nnoremap ;t :TableModeEnable<CR>
- " Save using ;s
- nnoremap ;s :w<CR>
- " Environment changing keybindings
- nnoremap ;ss :setlocal spell!<CR>
- nnoremap ;n :setlocal number! relativenumber!<CR>
- nnoremap ;w :set list!<CR>
- nnoremap ;p :LLPStartPreview<CR>
- nnoremap ;g :Goyo<CR>
- inoremap ;ss <Esc>:setlocal spell!<CR>i
- inoremap ;n <Esc>:setlocal number! relativenumber!<CR>i
- inoremap ;w <Esc>:set list!<CR>i
- inoremap ;p <Esc>:LLPStartPreview<CR>i
- inoremap ;g <esc>:Goyo<CR>i
- " Yank to end of line
- nnoremap Y y$
- " Change split window keybindings to be faster
- map <C-h> <C-w>h
- map <C-j> <C-w>j
- map <C-k> <C-w>k
- map <C-l> <C-w>l
- " Toggle ruler at line 80
- command! ToggleCC :let &cc = &cc == '' ? '81' : ''
- " Removes all trailing whitespaces
- noremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
- " Show a ruler on line 81
- noremap <F9> :let &cc = &cc == '' ? '81' : ''<CR>
- " Use jk instead of ESC
- inoremap jk <ESC>
- " Make move to the end of the line better
- nnoremap 0 $
- nnoremap 9 0
- " Add a banner to a config file
- inoremap ;b <Esc>:r ~/.vim/banners/main.txt<CR>
- " Navigating with guides
- inoremap ;l <Esc>/<++><Enter>"_c4l
- vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- " map <space><tab> <Esc>/<++><Enter>"_c4l
- " Use // and __ to turn on and off table mode while in insert mode
- function! s:isAtStartOfLine(mapping)
- let text_before_cursor = getline('.')[0 : col('.')-1]
- let mapping_pattern = '\V' . escape(a:mapping, '\')
- let comment_pattern = '\V'
- \. escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
- return (text_before_cursor =~? '^'
- \. ('\v(' . comment_pattern . '\v)?')
- \. '\s*\v' . mapping_pattern . '\v$')
- endfunction
- inoreabbrev <expr> <bar><bar>
- \ <SID>isAtStartOfLine('\|\|') ?
- \ '<c-o>:TableModeEnable<cr><bar><space><bar><left><left>' : '<bar><bar>'
- inoreabbrev <expr> __
- \ <SID>isAtStartOfLine('__') ?
- \ '<c-o>:silent! TableModeDisable<cr>' : '__'
- " -----------------------------------------------------------------------------
- " QUICK EDITING
- " -----------------------------------------------------------------------------
- nnoremap <leader>ve :tabnew ~/.vim/vimrc<CR>
- nnoremap <leader>ae :tabnew ~/.config/zsh/user_aliases<CR>
- nnoremap <leader>ch :tabnew ~/.chunkwmrc<CR>
- nnoremap <leader>sk :tabnew ~/.skhdrc<CR>
- nnoremap <leader>zs :tabnew ~/.zshrc<CR>
- " -----------------------------------------------------------------------------
- " PLUGINS
- " -----------------------------------------------------------------------------
- set nocompatible " be iMproved, required
- filetype off " required
- " set the runtime path to include Vundle and initialize
- set rtp+=~/.vim/bundle/Vundle.vim
- call vundle#begin()
- " let Vundle manage Vundle, required
- Plugin 'VundleVim/Vundle.vim'
- " A Plugin for distraction free writting in vim
- Plugin 'junegunn/goyo.vim'
- " A Vim Plugin for Lively Previewing LaTeX PDF Output
- Plugin 'xuhdev/vim-latex-live-preview'
- Plugin 'itchyny/lightline.vim'
- Plugin 'dhruvasagar/vim-table-mode'
- " Work with pywal
- Plugin 'dylanaraps/wal.vim'
- " Add grammar checking
- Plugin 'rhysd/vim-grammarous'
- call vundle#end() " required
- filetype plugin indent on " required
- " -----------------------------------------------------------------------------
- " STATUS BAR
- " -----------------------------------------------------------------------------
- " Makes the status bar look nice
- set laststatus=2
- let g:lightline = {
- \ 'colorscheme': 'wombat',
- \ 'active': {
- \ 'left': [ [ 'mode', 'paste' ],
- \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
- \ },
- \ 'component_function': {
- \ 'gitbranch': 'fugitive#head'
- \ },
- \ }
- " -----------------------------------------------------------------------------
- " ABBRIVIATIONS
- " -----------------------------------------------------------------------------
- " Short cuts
- abbr memail me@samerickson.xyz<Esc>A
- abbr sweb https://samerickson.xyz<Esc>A
- abbr gls https://gitlab.com/samericksn<Esc>A
- abbr se Sam Erickson<Esc>A
- " Common spelling mistakes
- abbr ehco echo<Esc>A
- " -----------------------------------------------------------------------------
- " Additional settings that need to be at the end of the file
- " -----------------------------------------------------------------------------
- colorscheme wal
- " -----------------------------------------------------------------------------
- " HEADERS
- " -----------------------------------------------------------------------------
- au Filetype html nnoremap ;h :0r ~/.vim/headers/html.txt<CR>
- au Filetype sh nnoremap ;h :0r ~/.vim/headers/script.txt<CR>
- au Filetype vim nnoremap ;h :0r ~/.vim/headers/vim.txt<CR>
- au Filetype cpp nnoremap ;h :0r ~/.vim/headers/cpp.txt<CR>
- au Filetype javascript nnoremap ;h :0r ~/.vim/headers/js.txt<CR>
- au Filetype css nnoremap ;h :0r ~/.vim/headers/css.txt<CR>
- au Filetype tex nnoremap ;h :0r ~/.vim/headers/latex.txt<CR>
- au Filetype markdown nnoremap ;h :0r ~/.vim/headers/markdown.txt<CR>
- " -----------------------------------------------------------------------------
- " VIMFILE SNIPPETS
- " -----------------------------------------------------------------------------
- " Commenting current line
- au Filetype vim nnoremap ;c :s!^!" !<CR>
- au Filetype vim nnoremap ;u :s!^" !!<CR>
- au Filetype vim inoremap ;c <Esc>:s!^!" !<CR>A
- au Filetype vim inoremap ;u <Esc>:s!^" !!<CR>A
- " ----------------------------------------------------------------------------
- " MARKDOWN SNIPPETS
- " -----------------------------------------------------------------------------
- au Filetype markdown inoremap ,n ---<Enter><Enter>
- au Filetype markdown inoremap ,b ****<++><Esc>F*hi
- au Filetype markdown inoremap ,s ~~~~<++><Esc>F~hi
- au Filetype markdown inoremap ,e **<++><Esc>F*i
- au Filetype markdown inoremap ,h ====<Space><++><Esc>F=hi
- au Filetype markdown inoremap ,i ![](<++>)<++><Esc>F[a
- au Filetype markdown inoremap ,a [](<++>)<++><Esc>F[a
- au Filetype markdown inoremap ,1 #<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,2 ##<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,3 ###<Space><Enter><++><Esc>kA
- au Filetype markdown inoremap ,l --------<Enter>
- au Filetype markdown inoremap ,c ```<CR><CR>```<CR><CR><++><Esc>3ki
- " For kmarkdown, while writting my blog
- au Filetype markdown inoremap
- \,h {% highlight %}<CR><++><CR>{% endhighlight %}<CR><CR><++><Esc>4k10li
- " -----------------------------------------------------------------------------
- " CPP SNIPPETS
- " -----------------------------------------------------------------------------
- " -----------------------------------------------------------------------------
- " CSS SNIPPETS
- " -----------------------------------------------------------------------------
- au Filetype css inoremap ;c /* */<++><Esc>7h
- au Filetype css nnoremap ;c :s/^\(.*\)$//* \1 *//<CR>
- " -----------------------------------------------------------------------------
- " HTML SNIPPETS
- " -----------------------------------------------------------------------------
- " Comments
- au Filetype html nnoremap ;u :s/^\(.*\)$/<!-- \1 -->/<CR>
- au Filetype html inoremap ;c <!-- --><CR><++><Esc>k2li
- " Header
- " Elements
- au Filetype html inoremap ,b <b></b><Space><++><Esc>FbT>i
- au Filetype html inoremap ,it <em></em><Space><++><Esc>FeT>i
- au Filetype html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
- au Filetype html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
- au Filetype html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
- au Filetype html inoremap ,li <Esc>o<li></li><Esc>F>a
- au Filetype html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
- au Filetype html inoremap ,td <td></td><++><Esc>Fdcit
- au Filetype html inoremap ,tr <tr></tr><Enter><++><Esc>kf<i
- au Filetype html inoremap ,th <th></th><++><Esc>Fhcit
- au Filetype html inoremap ,tab <table><Enter></table><Esc>O
- au Filetype html inoremap ,dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
- au Filetype html inoremap ,dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
- au Filetype html inoremap ,e
- \<a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
- au Filetype html inoremap ,ul
- \<ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
- au Filetype html inoremap ,ol
- \<ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
- " -----------------------------------------------------------------------------
- " LATEX SNIPPETS
- " -----------------------------------------------------------------------------
- au FileType tex inoremap ,em \emph{}<++><Esc>T{i
- au FileType tex inoremap ,bf \textbf{}<++><Esc>T{i
- au FileType tex inoremap ,li <Enter>\item<Space>
- au FIleType tex inoremap ,n \linebreak<CR><CR>
- au FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i
- au FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space>
- " Fix markdown syntax when writting posts for my blog
- function! MathAndLiquid()
- "" Define certain regions
- " Block math. Look for "$$[anything]$$"
- syn region math start=/\$\$/ end=/\$\$/
- " inline math. Look for "$[not $][anything]$"
- syn match math_block '\$[^$].\{-}\$'
- " Liquid single line. Look for "{%[anything]%}"
- syn match liquid '{%.*%}'
- " Liquid multiline. Look for "{%[anything]%}[anything]{%[anything]%}"
- syn region highlight_block start='{% highlight .*%}' end='{%.*%}'
- " Fenced code blocks, used in GitHub Flavored Markdown (GFM)
- syn region highlight_block start='```' end='```'
- "" Actually highlight those regions.
- hi link math Statement
- hi link liquid Statement
- hi link highlight_block Function
- hi link math_block Function
- endfunction
- " Call everytime we open a Markdown file
- autocmd BufRead,BufNewFile,BufEnter *.md,*.markdown call MathAndLiquid()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement