mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-22 14:44:11 -05:00
2ee0a576e3
visual, :wsudo and :esudo can now be run with :sudow and :sudoe, fixed a few issues where gvim settings wouldn't be enabled if gvim was started using :gui in command mode, = now does what + does so you can use - and + without holding shift for the + part, the ctrl/shift up/down/left/right + h/j/k/l stuff now works the same for both using the behaviour I suspect most people will expect from them, a 'lot' of behaviour that didn't work in tmux should now work provided tmux is using xterm-keys and has its $TERM set to screen*, a bunch of new default settings have been added to settings.vim (though they're mostly subtle or behind the scenes tweaks) and it's commented and organized better now too, and the gvim menubar no longer appears by default (but you can toggle it with <Ctrl><F1>)
87 lines
4.2 KiB
VimL
87 lines
4.2 KiB
VimL
"==============================="
|
|
" Vim Settings Configuration: "
|
|
"==============================="
|
|
|
|
"COMPATIBILITY SETTINGS: DOCUMENT AND ENVIRONMENT SETTINGS {{{
|
|
set nocompatible "enable vim specific capabilities
|
|
set hidden "tells vim to track things like undo history while a buffer is in the background
|
|
set encoding=utf-8 "set encoding
|
|
set fileformats=unix,dos,mac "set compatible line endings in order of preference
|
|
set backspace=indent,eol,start "enables backspacing
|
|
set mouse=a "enables extended mouse capabilities
|
|
set clipboard=unnamedplus "enable copy/paste support between vim and the environment's clipboard
|
|
|
|
set lazyredraw "only redraw what needs to be redrawn
|
|
set ttyfast "assume a fast connection to the terminal for better rendering
|
|
|
|
if $TERM =~ '^linux'
|
|
set t_Co=8 "use 8 colours when a vterm is detected
|
|
elseif !has("gui_running")
|
|
set t_Co=256 "assume 256 colours when any other terminal is detected
|
|
set ttymouse=xterm2 "sets the type of mouse to one we can expect in most gui envs
|
|
endif
|
|
"}}}
|
|
|
|
"GENERAL: ANYTHING THAT DOESN'T FIT ELSEWHERE {{{
|
|
set number "enable line numbers
|
|
set nowrap "disable line wrapping
|
|
set cursorline cursorcolumn "enable row/column highlighting
|
|
set visualbell "notify visually instead of with an audible bell
|
|
set splitright "add new tiles on the right (and not left) when added
|
|
set scrolloff=1 sidescrolloff=1 "start scrolling if the cursor is one position away from the edge
|
|
set list listchars=tab:>-,trail:- "display tabs as >--- and trailing spaces as -
|
|
set autochdir "current dir is file dir
|
|
set history=250 "undo history
|
|
set whichwrap=b,s,<,>,[,] "allow the cursor to wrap lines
|
|
set textwidth=0 "set an unlimited text width before breaking the line when line breaks are enabled
|
|
set nolinebreak "disable linebreaks, though this will be overridden by filetype plugins
|
|
set showmatch "show matching open bracket when closed bracket is inserted
|
|
set matchtime=5 "the amount of time the matching bracket will highlight
|
|
set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs
|
|
set laststatus=2 showcmd statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v] "statusline init and config
|
|
set hlsearch incsearch ignorecase smartcase "configure search
|
|
|
|
"load the system version of matchit if another hasn't already been
|
|
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
|
|
runtime! macros/matchit.vim
|
|
endif
|
|
|
|
"enable tab completion in command mode and configure how it handles extensions
|
|
set completeopt=longest,menuone
|
|
set wildmenu
|
|
set wildmode=list:longest,full
|
|
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.jpg,*.gif,*.png
|
|
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
|
|
"}}}
|
|
|
|
|
|
"SYNTAX: INDENTING, HIGHLIGHTING, FOLDING {{{
|
|
filetype plugin indent on
|
|
syntax on "turn syntax highlighting on
|
|
set foldmethod=syntax foldcolumn=1 foldlevel=3 "configure how folding code works
|
|
set formatoptions=roqnl12 "configure format options
|
|
"}}}
|
|
|
|
"FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{
|
|
au FileType mail setl spell "enable spellcheck for e-mail (mutt)
|
|
au FileType gitcommit setl spell "enable spellcheck in git commits
|
|
au BufNewFile,BufRead *.txt setl spell "enable spellcheck for text files (*.txt)
|
|
au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)
|
|
au BufNewFile,BufRead cjdroute.conf setf javascript "set syntax for *cjdroute.conf to javascript
|
|
au BufNewFile,BufRead ircd.conf setf javascript "set syntax for *ircd.conf to javascript
|
|
"}}}
|
|
|
|
"GVIM: GUI CONFIG OPTIONS {{{
|
|
set guicursor+=a:blinkon0 "disable the blinking cursor
|
|
|
|
set guioptions-=T "remove the toolbar
|
|
set guioptions-=m "remove the toolbar
|
|
|
|
if &wrap
|
|
set go-=b "disable the bottom scrollbar on launch iff text wrapping is enabled
|
|
else
|
|
set go+=b "enable the bottom scrollbar on launch iff text wrapping is disabled
|
|
endif
|
|
"}}}
|