-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
103 lines (83 loc) · 2.06 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
set nocompatible
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
" Initialize plugin system
call plug#end()
" airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='powerlineish'
" NERDTree
" https://github.com/scrooloose/nerdtree
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
map <C-n> :NERDTreeToggle<CR>
" fzf
nmap ; :Buffers<CR>
nmap t :Files<CR>
nmap r :Ag<CR>
" ==== my favorite configure ====
" ---- completion ----
set omnifunc=syntaxcomplete#Complete
" ---- indentation ----
set tabstop=2
set shiftwidth=2
set expandtab
set breakindent
set smarttab
set smartindent
" ---- colorscheme ----
set t_Co=256
colorscheme slate
" ---- appearance ----
syntax on
set number
set laststatus=2
set list
set listchars=tab:\ \ ,trail:_,precedes:<,extends:>
set showcmd
set splitbelow
set splitright
let g:netrw_liststyle=3
" ---- completion ----
set wildmenu
" ---- key bindings ----
nmap <ESC><ESC> :nohlsearch<CR><ESC>
nmap <C-H> :tabprev<CR>
nmap <C-L> :tabnext<CR>
set backspace=indent,eol,start
" ---- search ----
set hlsearch
set incsearch
set smartcase
set wrapscan
" ---- file settings ----
" swap file to the ramdisk
if has("win32")
set directory=/tmp
endif
if has("unix")
if system('uname')=~'Darwin'
" set directory=/Volumes/ramdisk
set directory=/tmp
elseif system('uname')=~'FreeBSD'
set directory=/tmp
else
set directory=/dev/shm
endif
endif
" encoding
set fileencodings=utf-8
set encoding=utf-8
set fileformats=unix,dos