vimrc/init.vim

134 lines
3.4 KiB
VimL
Raw Normal View History

2021-09-04 14:37:18 +00:00
" set the directory where vimrc git project is located
let vimrc_git=$HOME . "/src/vimrc"
" it is a big fat key, after all
" N.B. should come before plugins and plugin specific settings
let mapleader = "\<Space>"
" source aux files also under git control
let oldwd = getcwd()
exec "cd " . vimrc_git
source plug.vim
source airline.vim
source syntastic.vim
source fzf.vim
2021-12-29 20:52:08 +00:00
source lsp.vim
2021-09-04 14:37:18 +00:00
source mapping.vim
source jsonnet.vim
source nerdtree.vim
2021-12-29 20:52:08 +00:00
source wiki.vim
2021-09-04 14:37:18 +00:00
exec "cd " . oldwd
" set up a line number on the current line but relative above and below to help
" with motion commands
set number
set relativenumber
" even with the nice space/tab autodetect, prefer 4 for tab stops
" but let file type specifics override (for instance a setting of 2 for markdown
set tabstop=4
" default to folding on syntax
set foldmethod=syntax
" disable automatic line breaks, rely on visual wrapping instead
set textwidth=0
" make white space visible, where that matters
set list!
" except for help
autocmd FileType help setlocal nolist
" set up folding preferences
set fde=1
" vim's spelling is smart enough for code, to only check comments
set spell
" add a hint for long lines
set colorcolumn=120
" default to expanding tabs, I'm not insane
set expandtab
" change buffer behaviors to no longer require changes when hiding a buffer
set hidden
" look for vimrc in the current director as well as $MYVIMRC
set exrc
" make looking for local changes secure
set secure
" more secure
set modelines=0
" preserve some context
set scrolloff=3
" make the cursor a bit easier to follows
set cursorline
" make search work a bit more like tab completion in bash
set incsearch
set wildmode=longest:full
set wildmenu
" line break handling
set linebreak
set showbreak=+
" always on status line
set laststatus=2
" let backspace work more naturally
set backspace=start,indent,eol
" favor modern encoding
set enc=utf-8
" more readable config for list mode
set listchars+=nbsp,tab:»·,trail
set listchars-=eol:$
" smarter handling of case during search
set ignorecase
set smartcase
" centralize swap to have backup without clutter
set directory=$HOME/.var/nvim/swp//
2021-09-16 22:25:31 +00:00
" and undo
set undofile
set undodir=$HOME/.nvim/undodir
2021-09-04 14:37:18 +00:00
" make pastemode more accessible
set pastetoggle=<F2>
" save when moving away
au FocusLost * :wa
" make sure to set TERM to xterm-256color in terminal program or app
colorscheme breezy
set background=light
set termguicolors
" ensure autoread works, to detect file changes outside the editor
set autoread
au CursorHold * checktime
" for gui, make it easier to tell different instances apart
set title
" keep nvim from resetting font back to default from terminal config
set guicursor=
set guioptions-=r
set guioptions-=b
set guioptions-=T
set guioptions-=m
2022-02-23 13:19:55 +00:00
set mouse=nv
2022-09-18 14:25:46 +00:00
set gfn=FiraCode\ Nerd\ Font\ Mono:h12
2021-09-04 14:37:18 +00:00
" from https://stackoverflow.com/a/51424640
2022-06-01 11:46:18 +00:00
let s:fontsize = 14
2021-09-04 14:37:18 +00:00
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize+a:amount
2022-09-18 14:25:46 +00:00
:execute "set gfn=FiraCode\\ Nerd\\ Font\\ Mono:h" . s:fontsize
2021-09-04 14:37:18 +00:00
endfunction
noremap <C-Up> :call AdjustFontSize(1)<CR>
noremap <C-Down> :call AdjustFontSize(-1)<CR>
inoremap <C-Up> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-Down> <Esc>:call AdjustFontSize(-1)<CR>a
2022-07-30 19:28:00 +00:00
lua << EOF
2022-07-30 19:28:00 +00:00
require('nvim-projectconfig').setup({autocmd=true})
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
EOF