-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.ln
122 lines (95 loc) · 2.7 KB
/
vimrc.ln
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
let mapleader=","
set nocompatible
set encoding=utf-8
source ~/.vim/plugs.vim
syntax enable
set ruler
filetype on
au BufNewFile,BufRead *.eex set filetype=eruby
au BufNewFile,BufRead *.eex set syntax=html
augroup Markdown
autocmd!
autocmd BufRead,BufNewFile *.md set filetype=markdown
augroup END
" show a highlight on column 120
set colorcolumn=120
" no line wraps
set nowrap
" show whitespace(tab,trailing)
set list
set listchars=tab:\ \
set listchars+=trail:·
set listchars+=extends:►
set listchars+=precedes:◀
" no error or visual error annoyance
set noerrorbells
set visualbell t_vb=
set history=200 " Remember last 200 commands
set undolevels=1000 " 1000 undo
" search
set hlsearch
set showmatch
set incsearch
set ignorecase
set smartcase
" tabs and indents
set autoindent smartindent
set smarttab
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
set shiftround
set copyindent
set preserveindent
filetype on
filetype indent on
filetype plugin on
filetype plugin indent on
" turn off all backups and swp files
set nobackup
set nowritebackup
set noswapfile
set viminfo=
set laststatus=1
set statusline=%f " tail of the filename
set statusline+=%= " left/right separator
set statusline+=%y " filetype
set statusline+=%m " modified flag
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, " file encoding
set statusline+=%{&ff}] " file format
set statusline+=[%c, " cursor column
set statusline+=%l/%L] " cursor line/total lines
set cmdheight=1 " height of status line
set showcmd
" tab completion of commands
set wildmenu
set wildmode=list:longest
set backspace=2 " backspace over indent, eol, start
set showmatch " show maching bracket/parens
set foldmethod=indent " fold based on indent
set foldnestmax=10 " deepest fold is 10 levels
set nofoldenable " don't fold by defaul
set foldlevel=2
" toggle paste
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
" use the system clipboard by default, requires a Vim compiled
" with +clipboard - `brew install vim` is the easiest way
set clipboard=unnamed
" Source .vimrc on save
autocmd! bufwritepost ~/.vimrc nested source ~/.vimrc
set mouse=a
" Don't save history for netr
:let g:netrw_dirhistmax = 0
" Fix vim-tmux-navigator for nvim
if has('nvim')
nmap <BS> <C-W>h
endif
" Highlight JSX in JS files
let g:jsx_ext_required = 0
" Use skinny cursor when in insert mode
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = '1'
" Lightline config
source ~/.vim/after/plugin/settings/lightline.vim