-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
137 lines (115 loc) · 4.01 KB
/
.vimrc
File metadata and controls
137 lines (115 loc) · 4.01 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
set secure nocompatible
execute pathogen#infect()
syntax enable
filetype on
filetype plugin indent on
set t_Co=8
set ruler "Always show current position
set showtabline=2
set laststatus=2 "Always display the statusline in all windows
set noshowmode "Hide the default mode text (e.g. -- INSERT -- below the statusline)
set history=10000 " Sets how many lines of history VIM has to remember
set undolevels=10000
" Turn backup off BUT save swp file in directory
set directory=/tmp
set nobackup
set nowritebackup
"set nowb
set nostartofline
set modeline
set noendofline
"set noignorecase " No ignore case when searching
set ignorecase " Ignore case when searching
set smartcase " Override the 'ignorecase' option if the search pattern contains upper case characters.
set hlsearch " Highlight search results
set showfulltag
set showmatch " Show matching brackets when text indicator is over them
set showcmd
set ch=1 bs=2
set incsearch report=0 title
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab " Use the appropriate number of spaces to insert a <Tab>.
" Spaces are used in indents with the '>' and '<' commands
" and when 'autoindent' is on. To insert a real tab when
" 'expandtab' is on, use CTRL-V <Tab>.
set smarttab " Be smart when using tabs ;)
set autoindent " Copy indent from current line when starting a new line
" (typing <CR> in Insert mode or when using the "o" or "O"
" command).
set nomousefocus mousehide
set lazyredraw " Don't redraw while executing macros (good performance config)
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
set encoding=utf-8 " Set utf8 as standard encoding and en_US as the standard language
set wildmenu " Turn on the WiLd menu
set wcm=<TAB>
set pastetoggle=<F12> " Toggle paste mode on and off
set background=dark
hi comment ctermfg=darkgreen
hi NonText ctermfg=blue
hi search ctermfg=black ctermbg=yellow
"hi StatusLine ctermfg=blue ctermbg=white
"hi StatusLineNC ctermfg=black ctermbg=white
" map keys for tab
map <C-w> :tabprevious<cr>
nmap <C-w> :tabprevious<cr>
imap <C-w> <ESC>:tabprevious<cr>i
nmap <C-t> :tabnew<cr>
imap <C-t> <ESC>:tabnew<cr>
map <silent> <F4> :%s/\s\+$//g<CR>
map <silent> <F9> :runtime! syntax/html.vim<CR>
map <Leader>jt <Esc>:%!json_xs -f json -t json-pretty<CR>
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Set +x to file if first line contain #! and /bin/
function ModeChange()
if getline(1) =~ "^#!"
if getline(1) =~ "/bin/"
silent !chmod a+x <afile>
endif
endif
endfunction
au BufWritePost * call ModeChange()
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
if has("viminfo")
if filewritable(expand("$HOME/.vim/viminfo")) == 1 ||
\ filewritable(expand("$HOME/.vim/")) == 2
set viminfo=!,%,'5000,\"10000,:10000,/10000,n~/.vim/viminfo
else
set viminfo=
endif
endif
"AirLine Plugin Settings
let g:airline_theme='dark'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '◀'
let g:airline_linecolumn_prefix = '¶ '
let g:airline_fugitive_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
let g:airline#extensions#tabline#enabled = 1
" Protect large files from sourcing and other overhead.
" Files become read only
if !exists("my_auto_commands_loaded")
let my_auto_commands_loaded = 1
" Large files are > 10M
" Set options:
" eventignore+=FileType (no syntax highlighting etc
" assumes FileType always on)
" noswapfile (save copy of file)
" bufhidden=unload (save memory when other file is viewed)
" buftype=nowritefile (is read-only)
" undolevels=-1 (no undo possible)
let g:LargeFile = 1024 * 1024 * 10
augroup LargeFile
autocmd BufReadPre * let f=expand("<afile>") | if getfsize(f) > g:LargeFile | set eventignore+=FileType | setlocal noswapfile bufhidden=unload buftype=nowrite undolevels=-1 | else | set eventignore-=FileType | endif
augroup END
endif