vim/vimrc.d/settings.vim

106 lines
1.8 KiB
VimL

scriptencoding utf-8
set ttyfast
if &term ==? 'xterm-256color'
set termguicolors
endif
syntax on
set background=light
set fillchars=stl:\ ,stlnc:\ ,vert:\|
colorscheme monotonous
set guioptions-=mTrLb
set guioptions+=c
set updatetime=100
set backupdir=~/.vimtmp
set directory=~/.vimtmp
set tags+=./.tags,.tags;/home/ray/
" persisitent undo file
set undodir=/home/ray/.vim/undodir
set undofile
set clipboard=unnamedplus
set ignorecase
set smartcase
set wildmenu
set wildmode=longest:full,full
set hidden
set number relativenumber
set hlsearch
" set previewheight=24
" set splitbelow
set completeopt=longest,menuone
set completeopt-=preview
set nospell
set spelllang=en_gb
set dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
set thesaurus+=/usr/share/dict/mthesaur.txt
function! GetGitRoot() abort
let gitroot=system("git rev-parse --show-toplevel")
if gitroot=~?"^fatal"
let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
let gitstring .= expand("%t")
else
let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
let gitstring .= expand("%t")
let gitstring .= " [ " . system("git branch | grep '*' | cut -d ' ' -f2")
let gitstring .= " ] ( " . system('basename "' . gitroot . '"') . " )"
endif
return gitstring
endfunction
let &titlestring="%{GetGitRoot()}"
set title
set tabstop=8
set softtabstop=2
set shiftwidth=2
set shiftround
set expandtab
set autoindent
set textwidth=180
set formatoptions=cq
set wrapmargin=0
set foldcolumn=1
set signcolumn=yes
set colorcolumn=80
set iskeyword+=-
set scrolloff=10
set showcmd
set incsearch
set laststatus=2
set shortmess=aoOT
set cmdheight=2
set foldmethod=manual
set showmode
set autoindent
set breakindent
set showbreak=\ \ ↳\
set mouse=a
set listchars=eol,tab:>-,trail:~,extends:>,precedes:<,space
set foldtext=MyFoldText()
" vim: foldmethod=marker