dotfiles/editors/vim/ui.vim

116 lines
3.5 KiB
VimL
Raw Normal View History

syntax on
" Visual
set ruler
set guioptions=ce
set showmatch " Briefly jump to a paren once it's balanced
set linespace=2
set background=dark
set laststatus=2
2016-07-04 17:37:15 +10:00
colorscheme hybrid
" Tabs/Whitespace
set tabstop=2 " a Tab take up 2 spaces
set shiftwidth=2 " (un)indent 2 spaces at at ime
set autoindent " preserve previous indent level when inserting new line
set smarttab " insert/delete a tab's work of spaces at a time
set expandtab " insert actual spaces, not tabs
set nowrap " don't wrap long lines
set backspace=indent,eol,start " allow backspacing over everything in insert mode
2011-11-08 17:29:00 +11:00
" Toggle show tabs and trailing spaces (,c)
set list
2014-04-03 18:23:39 +11:00
set listchars=tab:⤑\ ,trail,eol:↵,nbsp:_
2011-11-08 17:29:00 +11:00
set fillchars=vert:\ ,fold:-
nnoremap <Leader>c :set list!<CR>
2011-11-08 17:29:00 +11:00
" Misc
set switchbuf=useopen " Don't re-open already opened buffers
set nostartofline " Avoid moving cursor to BOL when jumping around
set virtualedit=all " Let cursor move past the last char
set whichwrap=b,s,h,l,<,>,[,]
set autoread " watch for file changes
set mouse=a " mouse can be handy sometimes
2016-07-04 17:37:15 +10:00
if !has('nvim')
set ttymouse=xterm2 " Needed to get mouse working when in Tmux/screen
endif
set fileformats=unix
2012-01-07 04:41:39 +11:00
set history=1000
set nohidden " unload a buffer when abandoned, please
2012-01-07 04:41:39 +11:00
set title " Show title in Terminal
set shortmess=atI " abbreviate messages
" Bells
set novisualbell " No blinking
set noerrorbells " No noise.
set vb t_vb= " disable any beeps or flashes on error
" Searching
set hlsearch " highlight search matches and keep them highlighted
set incsearch " start matching search before hitting enter
set ignorecase " case-insensitive searching by default
set smartcase " but if searching with multiple cases, treat it as case-sensitive
2011-11-24 09:54:11 +11:00
" center current search result in middle of screen
2011-11-24 09:54:11 +11:00
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#zz
" Work around bug that leaves cursor in middle of line
nnoremap dd ddI<Esc>
" Tab completion
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.swp
" Directories for swp files
" Navigate cursor up/down by lines on screen, not lines in file
nmap j gj
nmap k gk
" Reselect visual block after adjusting indentation
vnoremap < <gv
vnoremap > >gv
" Nicer splitting
set splitbelow
set splitright
" Emacs-like keys for the command line
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-K> <C-U>
" Always show cursorline, but only in current window.
2011-11-24 09:55:32 +11:00
set scrolloff=3
set scrolljump=10
set number " line numbers
2012-01-10 10:38:48 +11:00
" I keep deleting words when I want to switch windows
imap <C-w> <Esc><C-w>
2012-03-29 06:31:02 +11:00
set clipboard=unnamed " OS X clipboard when yanking/pasting
" May only work in iTerm2 and may have other bad effects,
" but this shows a block in normal mode, and vertical bar
" in insert mode.
if exists('$TMUX')
" https://github.com/sjl/vitality.vim/issues/8#issuecomment-7664649
let &t_SI = "\<Esc>[3 q"
let &t_EI = "\<Esc>[0 q"
2019-07-22 16:21:32 +10:00
if !has('nvim')
set term=screen-256color
endif
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
2012-01-07 04:41:39 +11:00
runtime macros/matchit.vim