Last active
September 12, 2019 09:56
-
-
Save jdhao/bdb3f49d886fc09873a493ae33fb82b4 to your computer and use it in GitHub Desktop.
Filetype plugins for Neovim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <F9> :w <CR> :!g++ -Wall -std=c++11 % -o %<&&./%<<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Automatically save current file and execute it when pressing the <F9> key | |
" it is useful for small script | |
nnoremap <buffer> <F9> :execute 'w !python' shellescape(@%, 1)<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Only use the following character pairs for tex file | |
if &runtimepath =~? 'auto-pairs' | |
let b:AutoPairs = AutoPairsDefine({'<' : '>'}) | |
let b:AutoPairs = {'(':')', '[':']', '{':'}', '<':'>'} | |
endif | |
set textwidth=79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Disable inserting comment leader after hitting o or O | |
set formatoptions-=o | |
" Disable inserting comment leader after hitting <Enter> in insert mode | |
set formatoptions-=r | |
" Set the folding related options for vim script. Setting folding option | |
" in modeline is annoying in that the modeline get executed each time the | |
" window focus is lost (see http://tinyurl.com/yyqyyhnc) | |
set foldmethod=expr foldlevel=0 foldlevelstart=-1 | |
\ foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText() | |
" Use :help command for keyword when pressing `K` in vim file, | |
" see `:h K` and https://bre.is/wC3Ih-26u | |
set keywordprg=:help | |
" Only define following variable if Auto-pairs plugin is used | |
if &runtimepath =~? 'auto-pairs' | |
let b:AutoPairs = AutoPairsDefine({'<' : '>'}) | |
" Do not use `"` for vim script since `"` is also used for comment | |
let b:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", "`":"`", '<':'>'} | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These filetype plugins should be placed under
stdpath('config')/after/ftplugin
(the output ofstdpath('config')
is where Neovim read its configuration file).