vimrc update
This commit is contained in:
65
.vimrc
65
.vimrc
@@ -6,11 +6,6 @@ source ~/.config/nvim/defaults.vim
|
|||||||
"ln -s ~/.vimrc ~/.config/nvim/init.vim
|
"ln -s ~/.vimrc ~/.config/nvim/init.vim
|
||||||
"set rtp^=/usr/share/vim/vimfiles/
|
"set rtp^=/usr/share/vim/vimfiles/
|
||||||
|
|
||||||
if &t_Co > 2 || has("gui_running")
|
|
||||||
" Switch on highlighting the last used search pattern.
|
|
||||||
set hlsearch
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Only do this part when compiled with support for autocommands.
|
" Only do this part when compiled with support for autocommands.
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
|
|
||||||
@@ -42,14 +37,19 @@ Plug 'junegunn/fzf.vim'
|
|||||||
Plug 'tpope/vim-sensible'
|
Plug 'tpope/vim-sensible'
|
||||||
Plug 'chriskempson/base16-vim'
|
Plug 'chriskempson/base16-vim'
|
||||||
|
|
||||||
|
" Writing mode toggle `:Goyo` and `:Limelight`
|
||||||
|
Plug 'junegunn/goyo.vim'
|
||||||
|
Plug 'junegunn/limelight.vim'
|
||||||
|
|
||||||
"Comments
|
"Comments
|
||||||
"Plug 'tpope/vim-commentary'
|
|
||||||
"Plug 'tpope/surround'
|
|
||||||
"use \cc \cl c<space>, \cm \ci for commenting lines blocks in vis, norm modes
|
"use \cc \cl c<space>, \cm \ci for commenting lines blocks in vis, norm modes
|
||||||
"use ,c<space> to comment out line(s)
|
"use ,c<space> to comment out line(s)
|
||||||
Plug 'scrooloose/nerdcommenter'
|
Plug 'scrooloose/nerdcommenter'
|
||||||
Plug 'majutsushi/tagbar'
|
Plug 'majutsushi/tagbar'
|
||||||
" Plug 'vimwiki/vimwiki'
|
" Plug 'tpope/vim-commentary'
|
||||||
|
" Plug 'tpope/surround'
|
||||||
|
|
||||||
|
"Commonly used vim helpers
|
||||||
" Plug 'jedi-vim'
|
" Plug 'jedi-vim'
|
||||||
" Plug 'bling/vim-airline'
|
" Plug 'bling/vim-airline'
|
||||||
" Plug 'vim-airline/vim-airline-themes'
|
" Plug 'vim-airline/vim-airline-themes'
|
||||||
@@ -86,6 +86,7 @@ Plug 'majutsushi/tagbar'
|
|||||||
" Plug 'vim-pandoc'
|
" Plug 'vim-pandoc'
|
||||||
|
|
||||||
"Markdown
|
"Markdown
|
||||||
|
" Plug 'vimwiki/vimwiki'
|
||||||
" Plug 'suan/vim-instant-markdown' " Markdown preview instant-markdown-d
|
" Plug 'suan/vim-instant-markdown' " Markdown preview instant-markdown-d
|
||||||
"next one uses a rust lib for fast async md, requires rust/cargo install
|
"next one uses a rust lib for fast async md, requires rust/cargo install
|
||||||
" Plug 'euclio/vim-markdown-composer'
|
" Plug 'euclio/vim-markdown-composer'
|
||||||
@@ -103,6 +104,8 @@ filetype plugin indent on
|
|||||||
"let g:polyglot_disabled = ['markdown']
|
"let g:polyglot_disabled = ['markdown']
|
||||||
let g:markdown_fenced_languages = ['html','r', 'javascript', 'python', 'sh', 'bash=sh', 'css', 'js=javascript', 'json=javascript']
|
let g:markdown_fenced_languages = ['html','r', 'javascript', 'python', 'sh', 'bash=sh', 'css', 'js=javascript', 'json=javascript']
|
||||||
|
|
||||||
|
"Tagbar config
|
||||||
|
nmap <F8> :TagbarToggle<CR>
|
||||||
let g:tagbar_type_markdown = {
|
let g:tagbar_type_markdown = {
|
||||||
\ 'ctagstype' : 'markdown',
|
\ 'ctagstype' : 'markdown',
|
||||||
\ 'kinds' : [
|
\ 'kinds' : [
|
||||||
@@ -132,6 +135,7 @@ let g:tagbar_type_bib = {
|
|||||||
\ ]
|
\ ]
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
"Python repl config
|
||||||
let g:python_host_prog = '/usr/bin/python3'
|
let g:python_host_prog = '/usr/bin/python3'
|
||||||
let g:loaded_python3_provider = 1
|
let g:loaded_python3_provider = 1
|
||||||
|
|
||||||
@@ -143,12 +147,12 @@ let g:loaded_python3_provider = 1
|
|||||||
"xmap ,r <Plug>(iron-send-motion)
|
"xmap ,r <Plug>(iron-send-motion)
|
||||||
"nmap yR V,r
|
"nmap yR V,r
|
||||||
|
|
||||||
|
|
||||||
"Neomake config
|
"Neomake config
|
||||||
" Full config: when writing or reading a buffer, and on changes in insert and
|
" Full config: when writing or reading a buffer, and on changes in insert and
|
||||||
" normal mode (after 1s; no delay when writing).
|
" normal mode (after 1s; no delay when writing).
|
||||||
"call neomake#configure#automake('nrwi', 500)
|
"call neomake#configure#automake('nrwi', 500)
|
||||||
|
|
||||||
|
"General vim config
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set expandtab
|
set expandtab
|
||||||
@@ -156,41 +160,46 @@ set expandtab
|
|||||||
" set relativenumber
|
" set relativenumber
|
||||||
" set hlsearch
|
" set hlsearch
|
||||||
" set spell
|
" set spell
|
||||||
|
|
||||||
|
"Mouse/trackpad pointer config
|
||||||
" set mouse=a "already set by defaults.vim
|
" set mouse=a "already set by defaults.vim
|
||||||
set mouse=n
|
set mouse=n
|
||||||
" OR try set mouse=r mouse=&
|
" OR try set mouse=r mouse=&
|
||||||
" shortcuts for next or prev file like after vim *.py
|
|
||||||
|
" Shortcuts for next or prev file like after vim *.py
|
||||||
" :map v :n<enter>
|
" :map v :n<enter>
|
||||||
" :map V :N<enter>
|
" :map V :N<enter>
|
||||||
" or just use :n or :N followed by the dot . cmd!
|
" or just use :n or :N followed by the dot . cmd!
|
||||||
" quick save from insert mode if any changes
|
|
||||||
|
|
||||||
|
"Quick save config
|
||||||
|
imap ;s <ESC>:update<enter>
|
||||||
imap jjw <ESC>:update<enter>
|
imap jjw <ESC>:update<enter>
|
||||||
"<CR> vs <enter> and running code
|
"<CR> vs <enter> and running code
|
||||||
imap jk <ESC>`^
|
|
||||||
":imap kj <ESC>
|
"Quick mode exit config
|
||||||
" Two semicolons are easy to type. The `^ fixes the cursor position.
|
" Two semicolons are easy to type. The `^ fixes the cursor position.
|
||||||
" imap ;; <ESC>`^
|
imap ;; <ESC>`^
|
||||||
inoremap <Tab> <Esc>`^
|
inoremap <Tab> <Esc>`^
|
||||||
"imap ;; i
|
" imap jk <ESC>`^
|
||||||
" Just press Space to enter insert mode.
|
" Just press Space to enter insert mode while in normal mode.
|
||||||
nmap <Space> i
|
nmap <Space> i
|
||||||
" On gvim and Linux console Vim, you can also use ctrl-Space.
|
" On gvim and Linux console Vim, you can also use ctrl-Space.
|
||||||
" :imap <C-Space> <>
|
" :imap <C-Space> <>
|
||||||
|
|
||||||
|
"Clipboard config
|
||||||
" copy with ctrl-c in visual highlight mode
|
" copy with ctrl-c in visual highlight mode
|
||||||
vmap <C-c> "+y
|
vmap <C-c> "+y
|
||||||
|
|
||||||
"use system clipboard: Now yank y, delete d, or paste p work to/from system
|
"use system clipboard: Now yank y, delete d, or paste p work to/from system
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamedplus
|
||||||
|
|
||||||
"auto fix common sp errors
|
"Auto fix common spelling errors
|
||||||
:ab teh the
|
:ab teh the
|
||||||
:ab Teh The
|
:ab Teh The
|
||||||
:ab adn and
|
:ab adn and
|
||||||
:ab Adn And
|
:ab Adn And
|
||||||
|
|
||||||
let mapleader = ','
|
let mapleader = ','
|
||||||
nmap <F8> :TagbarToggle<CR>
|
|
||||||
|
|
||||||
if filereadable(expand("~/.vimrc_background"))
|
if filereadable(expand("~/.vimrc_background"))
|
||||||
let base16colorspace=256
|
let base16colorspace=256
|
||||||
@@ -222,3 +231,21 @@ let g:NERDSpaceDelims = 1
|
|||||||
"Use compact syntax for prettified multi-line comments
|
"Use compact syntax for prettified multi-line comments
|
||||||
let g:NERDCompactSexyComs = 1
|
let g:NERDCompactSexyComs = 1
|
||||||
|
|
||||||
|
"gvim options
|
||||||
|
" if &t_Co > 2 || has("gui_running")
|
||||||
|
if has("gui_running")
|
||||||
|
" Switch on highlighting the last used search pattern.
|
||||||
|
set hlsearch
|
||||||
|
" Set font
|
||||||
|
set gfn=Inconsolata\ 13
|
||||||
|
" Can toggle gui toolbar with `T` and menu with `m` in guioptions:
|
||||||
|
" default is go=aegimrLtT
|
||||||
|
set go=aegLt
|
||||||
|
":set go+=m or go-=m to toggle menu
|
||||||
|
colorscheme base16-ocean
|
||||||
|
autocmd VimEnter * Goyo
|
||||||
|
autocmd VimEnter * Limelight0.8
|
||||||
|
"Switch cursor blink rate to 0msec
|
||||||
|
set guicursor+=a:blinkon0
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user