From 3f0e83cb4816e637d8c916fb77217e1c5824dbe5 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Thu, 3 Dec 2020 16:45:06 +0100 Subject: initial commit: most of previous configuration reworked --- dotfiles/vimrc.vim | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 dotfiles/vimrc.vim (limited to 'dotfiles/vimrc.vim') diff --git a/dotfiles/vimrc.vim b/dotfiles/vimrc.vim new file mode 100644 index 0000000..a0451c6 --- /dev/null +++ b/dotfiles/vimrc.vim @@ -0,0 +1,139 @@ +" Some global variables are defined in ../vim.nix + +" Better default options {{{ + +set undofile +set backup +set backupdir-=. + +set mouse=a + +set ignorecase +set smartcase + +set smartindent +set tabstop=4 +set shiftwidth=4 + +set inccommand=split + +set scrolloff=1 +set sidescrolloff=5 + +set colorcolumn=80 +set cursorline + +set modeline + +set title + +set wildmode=longest:full,full + +let g:maplocalleader = ',' +let g:mapleader = ';' + +" If previously opened jump to the last position in the file +au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + +let &grepprg = g:ripgrep_path . ' --vimgrep $*' +let &grepformat = '%f:%l:%c:%m,' . &grepformat + +let g:tex_flavor = 'latex' + +" }}} + +" Colors, Statusline, Tabline, Code display {{{ + +set termguicolors +let g:gruvbox_contrast_dark = 'soft' +let g:gruvbox_italic = 1 +set background=dark +colorscheme gruvbox + +" Doesn't do anything because the tabline gets overwritten by lightline +"exe 'hi! TabLineSel guifg=' . g:dominant_color + +let g:lightline = { + \ 'colorscheme': 'gruvbox', + \ 'subseparator': { 'left': '|', 'right': '|' }, + \ 'tab_linesubseparator': { 'left': '|', 'right': '|' }, + \ } + +set noshowmode + +" Do not set "trail:-" because it messes up the highlighting +set listchars=tab:│\ ,extends:>,precedes:<,nbsp:+ +set list + +set fillchars=fold:─,vert:│ + +highlight ExtraWhitespace term=inverse cterm=inverse gui=inverse +" Show trailing whitespace and spaces before tabs: +autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL + +" }}} + +" Mappings {{{ + +call camelcasemotion#CreateMotionMappings(g:maplocalleader) + +nmap =of :set =(&formatoptions =~ "a") ? 'formatoptions-=a' : 'formatoptions+=a' + +" }}} + +set completefunc=syntaxcomplete#Complete +set completeopt+=noinsert,noselect + +" Deoplete {{{ + +let g:deoplete#enable_at_startup = 1 + +" }}} + +" Neosnippets {{{ + +imap (neosnippet_expand_or_jump) +smap (neosnippet_expand_or_jump) +xmap (neosnippet_expand_target) + +set conceallevel=2 +set concealcursor=nv + +" }}} + +" CtrlP {{{ +let g:ctrlp_user_command = g:fd_path . ' --type f --color never "" %s' +let g:ctrlp_use_caching = 0 +" }}} + +" LanguageClient {{{ +let g:LanguageClient_loggingFile = stdpath('data') . '/LanguageClient.log' +let g:LanguageClient_serverStderr = stdpath('data') . '/LanguageServer.log' +" }}} + +" VimWiki {{{ + " {'path': '~/Documents/Wiki', 'path_html': '~/Documents/Wiki/html'} \ +let g:vimwiki_list = [ + \ {'path': '~/Documents/Wiki/personal', + \ 'path_html': '~/Documents/Wiki/personal/html', + \ 'auto_tags': 1}, + \ {'path': '~/Documents/Wiki/science', 'path_html': '~/Documents/Wiki/science/html', 'auto_tags': 1}, + \ {'path': '~/Documents/Wiki/work', 'path_html': '~/Documents/Wiki/work/html', 'auto_tags': 1}, +\ ] + +let g:vimwiki_global_ext = 0 + +let g:vimwiki_auto_header = 1 +let g:vimwiki_hl_headers = 1 +let g:vimwiki_hl_cb_checked = 1 +let g:vimwiki_html_header_numbering = 2 +let g:vimwiki_html_header_numbering_sym = '.' + +let g:vimwiki_links_header_level = 2 +let g:vimwiki_tags_header_level = 2 +let g:vimwiki_toc_header_level = 2 + +call deoplete#custom#var('omni', 'input_patterns', { 'vimwiki': '\[\[\w*|\:\w+' }) +" }}} + +" vim: fdm=marker -- cgit v1.2.3