diff --git a/core/bell.vim b/core/bell.vim new file mode 100644 index 0000000..fc9f84e --- /dev/null +++ b/core/bell.vim @@ -0,0 +1,3 @@ +" disable visualbell +set visualbell +set t_vb= diff --git a/core/clipboard.vim b/core/clipboard.vim new file mode 100644 index 0000000..711e6cd --- /dev/null +++ b/core/clipboard.vim @@ -0,0 +1 @@ +set clipboard=unnamed,unnamedplus,autoselect diff --git a/core/cmdline_info.vim b/core/cmdline_info.vim new file mode 100644 index 0000000..16614cf --- /dev/null +++ b/core/cmdline_info.vim @@ -0,0 +1,5 @@ +" show a ruler and show the current command in the bottom right +if has('cmdline_info') + set ruler + set showcmd +endif diff --git a/core/encoding.vim b/core/encoding.vim new file mode 100644 index 0000000..bf3a2d3 --- /dev/null +++ b/core/encoding.vim @@ -0,0 +1,4 @@ +if has('multi_byte') + set encoding=utf-8 + set termencoding=utf-8 +endif diff --git a/core/escape.vim b/core/escape.vim index 039830e..dd173a8 100644 --- a/core/escape.vim +++ b/core/escape.vim @@ -2,4 +2,5 @@ imap jk imap JK imap Jk +set ttimeout set timeoutlen=500 diff --git a/core/history.vim b/core/history.vim new file mode 100644 index 0000000..85e0bff --- /dev/null +++ b/core/history.vim @@ -0,0 +1,4 @@ +" set the history far higher (default 50) +if &history < 1000 + set history=1000 +endif diff --git a/core/line_numbers.vim b/core/line_numbers.vim index ff70fb0..cf90baa 100644 --- a/core/line_numbers.vim +++ b/core/line_numbers.vim @@ -1,3 +1,5 @@ +set number + if v:version >= 704 aug LineNumbers au! diff --git a/core/linewrap.vim b/core/linewrap.vim index 979a5e2..8ac9be3 100644 --- a/core/linewrap.vim +++ b/core/linewrap.vim @@ -1,5 +1,5 @@ -if has("linebreak") - let &showbreak = "↳ " +if has('linebreak') + let &showbreak = '↳ ' set breakindent set breakindentopt=sbr endif diff --git a/core/misc.vim b/core/misc.vim new file mode 100644 index 0000000..9aa3718 --- /dev/null +++ b/core/misc.vim @@ -0,0 +1,32 @@ +set backspace=indent,eol,start +set complete-=i +set nrformats-=octal +set shiftround +set display+=lastline +set showmatch +set shortmess=aoOtTI +set autochdir +set report=0 +set updatetime=1500 +set switchbuf=useopen,usetab +set pumheight=10 +set diffopt+=context:3 +set matchtime=2 + +" set the terminal colors to 256 if not in a VT +if exists($TERM) + if &t_Co == 8 && $TERM !~# '^linux' + set t_Co=256 + endif +endif + +if &listchars ==# 'eol:$' + set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ +endif + +" load the matchit macros +if !exists('g:loaded_matchit') && findfile('plugins/matchit.vim', &rtp) ==# '' + runtime! macros/matchit.vim +endif + + diff --git a/core/mouse.vim b/core/mouse.vim new file mode 100644 index 0000000..c676d66 --- /dev/null +++ b/core/mouse.vim @@ -0,0 +1,4 @@ +" enable mouse support +if has('mouse') + set mouse=a +endif diff --git a/core/scrolling.vim b/core/scrolling.vim new file mode 100644 index 0000000..e97734f --- /dev/null +++ b/core/scrolling.vim @@ -0,0 +1,10 @@ + +" set scroll offset slightly higher so that the next or previous line can be seen +if !&scrolloff + set scrolloff=1 +endif + +" same as with scroll offset but for horizontal scrolling +if !&sidescrolloff + set sidescrolloff=5 +endif diff --git a/core/search.vim b/core/search.vim index 8a1edb1..3196b14 100644 --- a/core/search.vim +++ b/core/search.vim @@ -1,2 +1,11 @@ set ignorecase set smartcase + +" highlight searches and search while typing +if has('extra_search') + set hlsearch + set incsearch + if maparg('', 'n') ==# '' + nnoremap :nohlsearch + endif +endif diff --git a/core/split.vim b/core/split.vim new file mode 100644 index 0000000..ca09d80 --- /dev/null +++ b/core/split.vim @@ -0,0 +1,5 @@ +" split the windows more 'naturally' +if has('windows') + set splitbelow + set splitright +endif diff --git a/core/statusline.vim b/core/statusline.vim new file mode 100644 index 0000000..f11b610 --- /dev/null +++ b/core/statusline.vim @@ -0,0 +1,2 @@ +" always show a status line +set laststatus=2 diff --git a/core/syntax_highlighting.vim b/core/syntax_highlighting.vim new file mode 100644 index 0000000..35d06c7 --- /dev/null +++ b/core/syntax_highlighting.vim @@ -0,0 +1,9 @@ +" enable filetype plugins +if has('autocmd') + filetype plugin indent on +endif + +" enable syntax highlighting +if has('syntax') + syntax enable +endif diff --git a/core/tabs.vim b/core/tabs.vim index df59157..cd9ec2f 100644 --- a/core/tabs.vim +++ b/core/tabs.vim @@ -4,3 +4,8 @@ nnoremap tk :tabprev nnoremap tl :tablast nnoremap tn :tabnew nnoremap tq :tabclose + +" increase the maximal number of tabpages (default 10) +if &tabpagemax < 50 + set tabpagemax=50 +endif diff --git a/core/tabstops.vim b/core/tabstops.vim index 71333c8..4140cc2 100644 --- a/core/tabstops.vim +++ b/core/tabstops.vim @@ -1,7 +1,9 @@ "set softtabstop=4 "set shiftwidth=4 "set expandtab +set autoindent +set smarttab if has("smartindent") - set smartindent + set smartindent endif diff --git a/core/undo.vim b/core/undo.vim index 72835ed..c07c72c 100644 --- a/core/undo.vim +++ b/core/undo.vim @@ -2,6 +2,6 @@ nnoremap U :redo nnoremap if v:version >= 704 - set undofile - set undolevels=1000 + set undofile + set undolevels=1000 endif diff --git a/core/visual.vim b/core/visual.vim new file mode 100644 index 0000000..b2c031a --- /dev/null +++ b/core/visual.vim @@ -0,0 +1,4 @@ +" allow the cursor to be positioned where no characters are in virtual block mode +if has('virtualedit') + set virtualedit=block +endif diff --git a/core/wildmenu.vim b/core/wildmenu.vim index 3d2a01c..49ebb5b 100644 --- a/core/wildmenu.vim +++ b/core/wildmenu.vim @@ -1,2 +1,6 @@ set wildmode=longest:full,list set wildignore=.bak,.old,.swp,~ + +if has('wildmenu') + set wildmenu +endif diff --git a/core/write_and_quit.vim b/core/write_and_quit.vim index 26eaf29..d797417 100644 --- a/core/write_and_quit.vim +++ b/core/write_and_quit.vim @@ -1,5 +1,6 @@ set confirm set autowrite +set autoread command! Wq wq command! WQ wq