" ~/.vim/vimrc """"""""""""""""""""""""""""""""""""""""""""""""" " vundle set nocompatible filetype off " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " Plug-in manager for Vim Plugin 'VundleVim/Vundle.vim' " Git interface ##### " Plugin 'tpope/vim-fugitive' " Tree explorer plugin Plugin 'scrooloose/nerdtree' " Showing git status flags Plugin 'Xuyuanp/nerdtree-git-plugin' " Syntax checking Plugin 'scrooloose/syntastic' " Code-completion engine " Plugin 'ycm-core/YouCompleteMe' " Plugin 'davidhalter/jedi-vim' Plugin 'ervandew/supertab' " Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box Plugin 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' } " Nerdtree features " Plugin 'tiagofumo/vim-nerdtree-syntax-highlight' " Rainbow brackets for Vim Plugin 'frazrepo/vim-rainbow' " Color schemes " Plugin 'altercation/vim-colors-solarized' Plugin 'tomasiser/vim-code-dark' " Statusline/tabline plugin: NORMAL, INSERT, etc Plugin 'itchyny/lightline.vim' " Commenting powers " Plugin 'preservim/nerdcommenter' Plugin 'tpope/vim-commentary' " Markdown preview Plugin 'iamcco/markdown-preview.nvim' " Buffers Plugin 'bling/vim-bufferline' call vundle#end() filetype plugin indent on """"""""""""""""""""""""""""""""""""""""""""""""" " Put your non-Plugin stuff after this line " Set standard encoding set encoding=utf-8 " Allow backspacing over everything in insert mode set backspace=indent,eol,start " Set auto ident set autoindent " System clipboard set clipboard=unnamed " Set PEP8 " autocmd BufRead,BufNewFile *.py " \ set tabstop=4 " \ set softtabstop=4 " \ set shiftwidth=4 " \ set textwidth=79 " \ set expandtab " \ set autoindent " \ set fileformat=unix " Show spelling mistakes " set spell " Enable syntax highlighting syntax on filetype on " Set line number " set number relativenumber set number " Enable folding set foldmethod=indent set foldlevel=99 " Flagging Unnecessary Whitespace " au BufRead,BufNewFile *.py,*.pyw,*.c,*.cpp,*.h match BadWhitespace /\s\+$/ " Preserve indentation " to avoid messed up, press the F2 key before you paste code set pastetoggle= " Mapping search CTRL-f, CTRL-SHIFT-f map / map :vimgrep / " YouCompleteMe config " let g:ycm_python_interpreter_path = '/usr/bin/python3' " In NORMAL mode, Switch tab with Ctrl + Right Arrow nnoremap :tabnext " Switch tab with Ctrl + Left Arrow nnoremap :tabprev " Create new tab with Ctrl + Tab nnoremap :tabnew " In INSERT mode, Switch tab with Ctrl + Right Arrow inoremap :tabnexti " Switch tab with Ctrl + Left Arrowe inoremap :tabprevi " Create new tab with Ctrl + Tab inoremap :tabnewi " Start NERDTree. If a file is specified, move the cursor to its window. autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif " Set rainbow active 'frazrepo/vim-rainbow' let g:rainbow_active = 1 " Enable tomasiser/vim-code-dark colorscheme codedark " python-mode config let g:pymode_python = 'python3' " " NERD Commenter config " filetype plugin on " " Create default mappings " let g:NERDCreateDefaultMappings = 1 " " Add spaces after comment delimiters by default " let g:NERDSpaceDelims = 1 " " Use compact syntax for prettified multi-line comments " let g:NERDCompactSexyComs = 1 " " Align line-wise comment delimiters flush left instead of following code indentation " let g:NERDDefaultAlign = 'left' " " Set a language to use its alternate delimiters by default " let g:NERDAltDelims_java = 1 " " Add your own custom formats or override the defaults " let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } " " Allow commenting and inverting empty lines (useful when commenting a region) " let g:NERDCommentEmptyLines = 1 " " Enable trimming of trailing whitespace when uncommenting " let g:NERDTrimTrailingWhitespace = 1 " " Enable NERDCommenterToggle to check all selected lines is commented or not " let g:NERDToggleCheckAllLines = 1 " vim-commentary mapping " nnoremap :normal gcc " vnoremap :normal gc " nmap gcc " vmap gc " Markdown preview " set to 1, nvim will open the preview window after entering the markdown buffer " default: 0 let g:mkdp_auto_start = 0 " set to 1, the nvim will auto close current preview window when change " from markdown buffer to another buffer " default: 1 let g:mkdp_auto_close = 1 " set to 1, the vim will refresh markdown when save the buffer or " leave from insert mode, default 0 is auto refresh markdown as you edit or " move the cursor " default: 0 let g:mkdp_refresh_slow = 0 " set to 1, the MarkdownPreview command can be use for all files, " by default it can be use in markdown file " default: 0 let g:mkdp_command_for_global = 0 " set to 1, preview server available to others in your network " by default, the server listens on localhost (127.0.0.1) " default: 0 let g:mkdp_open_to_the_world = 0 " use custom IP to open preview page " useful when you work in remote vim and preview on local browser " more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9 " default empty let g:mkdp_open_ip = '' " specify browser to open preview page " for path with space " valid: `/path/with\ space/xxx` " invalid: `/path/with\\ space/xxx` " default: '' let g:mkdp_browser = '' " set to 1, echo preview page url in command line when open preview page " default is 0 let g:mkdp_echo_preview_url = 0 " a custom vim function name to open preview page " this function will receive url as param " default is empty let g:mkdp_browserfunc = '' " options for markdown render " mkit: markdown-it options for render " katex: katex options for math " uml: markdown-it-plantuml options " maid: mermaid options " disable_sync_scroll: if disable sync scroll, default 0 " sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle' " middle: mean the cursor position alway show at the middle of the preview page " top: mean the vim top viewport alway show at the top of the preview page " relative: mean the cursor position alway show at the relative positon of the preview page " hide_yaml_meta: if hide yaml metadata, default is 1 " sequence_diagrams: js-sequence-diagrams options " content_editable: if enable content editable for preview page, default: v:false " disable_filename: if disable filename header for preview page, default: 0 let g:mkdp_preview_options = { \ 'mkit': {}, \ 'katex': {}, \ 'uml': {}, \ 'maid': {}, \ 'disable_sync_scroll': 0, \ 'sync_scroll_type': 'middle', \ 'hide_yaml_meta': 1, \ 'sequence_diagrams': {}, \ 'flowchart_diagrams': {}, \ 'content_editable': v:false, \ 'disable_filename': 0, \ 'toc': {} \ } " use a custom markdown style must be absolute path " like '/Users/username/markdown.css' or expand('~/markdown.css') let g:mkdp_markdown_css = '' " use a custom highlight style must absolute path " like '/Users/username/highlight.css' or expand('~/highlight.css') let g:mkdp_highlight_css = '' " use a custom port to start server or empty for random let g:mkdp_port = '' " preview page title " ${name} will be replace with the file name let g:mkdp_page_title = '「${name}」' " recognized filetypes " these filetypes will have MarkdownPreview... commands let g:mkdp_filetypes = ['markdown'] " set default theme (dark or light) " By default the theme is define according to the preferences of the system let g:mkdp_theme = 'dark' " normal/insert " MarkdownPreview " MarkdownPreviewStop " MarkdownPreviewToggle " example nmap MarkdownPreview nmap MarkdownPreviewStop nmap MarkdownPreviewToggle " vim-nerdtree-syntax-highlight config " let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match " let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name