Drop vscode, simplify
This commit is contained in:
parent
3475ed33b2
commit
ca3bd5d9f8
1 changed files with 109 additions and 117 deletions
222
init.vim
222
init.vim
|
@ -1,132 +1,124 @@
|
||||||
if !exists('g:vscode')
|
" set the directory where vimrc git project is located
|
||||||
" set the directory where my vimrc git project is located
|
let vimrc_git=$HOME . "/src/vimrc"
|
||||||
source ~/.config/nvim/local.vim
|
|
||||||
|
|
||||||
" it is a big fat key, after all
|
" it is a big fat key, after all
|
||||||
" N.B. should come before plugins and plugin specific settings
|
" N.B. should come before plugins and plugin specific settings
|
||||||
let mapleader = "\<Space>"
|
let mapleader = "\<Space>"
|
||||||
|
|
||||||
" source aux files also under git control
|
" source aux files also under git control
|
||||||
let oldwd = getcwd()
|
let oldwd = getcwd()
|
||||||
exec "cd " . vimrc_git
|
exec "cd " . vimrc_git
|
||||||
source plug.vim
|
source plug.vim
|
||||||
source ncm2.vim
|
source ncm2.vim
|
||||||
source airline.vim
|
source airline.vim
|
||||||
source syntastic.vim
|
source syntastic.vim
|
||||||
source fzf.vim
|
source fzf.vim
|
||||||
source mapping.vim
|
source mapping.vim
|
||||||
source jsonnet.vim
|
source jsonnet.vim
|
||||||
source racer.vim
|
source racer.vim
|
||||||
source lsp.vim
|
source lsp.vim
|
||||||
source autoformat.vim
|
source autoformat.vim
|
||||||
source nerdtree.vim
|
source nerdtree.vim
|
||||||
exec "cd " . oldwd
|
exec "cd " . oldwd
|
||||||
|
|
||||||
" set up a line number on the current line but relative above and below to help
|
" set up a line number on the current line but relative above and below to help
|
||||||
" with motion commands
|
" with motion commands
|
||||||
set number
|
set number
|
||||||
set relativenumber
|
set relativenumber
|
||||||
|
|
||||||
" even with the nice space/tab autodetect, prefer 4 for tab stops
|
" 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
|
" but let file type specifics override (for instance a setting of 2 for markdown
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
" default to folding on syntax
|
" default to folding on syntax
|
||||||
set foldmethod=syntax
|
set foldmethod=syntax
|
||||||
" disable automatic line breaks, rely on visual wrapping instead
|
" disable automatic line breaks, rely on visual wrapping instead
|
||||||
set textwidth=0
|
set textwidth=0
|
||||||
" make white space visible, where that matters
|
" make white space visible, where that matters
|
||||||
set list!
|
set list!
|
||||||
" except for help
|
" except for help
|
||||||
autocmd FileType help setlocal nolist
|
autocmd FileType help setlocal nolist
|
||||||
" set up folding preferences
|
" set up folding preferences
|
||||||
set fde=1
|
set fde=1
|
||||||
" vim's spelling is smart enough for code, to only check comments
|
" vim's spelling is smart enough for code, to only check comments
|
||||||
set spell
|
set spell
|
||||||
" add a hint for long lines
|
" add a hint for long lines
|
||||||
set colorcolumn=120
|
set colorcolumn=120
|
||||||
" default to expanding tabs, I'm not insane
|
" default to expanding tabs, I'm not insane
|
||||||
set expandtab
|
set expandtab
|
||||||
|
|
||||||
" change buffer behaviors to no longer require changes when hiding a buffer
|
" change buffer behaviors to no longer require changes when hiding a buffer
|
||||||
set hidden
|
set hidden
|
||||||
|
|
||||||
" look for vimrc in the current director as well as $MYVIMRC
|
" look for vimrc in the current director as well as $MYVIMRC
|
||||||
set exrc
|
set exrc
|
||||||
" make looking for local changes secure
|
" make looking for local changes secure
|
||||||
set secure
|
set secure
|
||||||
" more secure
|
" more secure
|
||||||
set modelines=0
|
set modelines=0
|
||||||
" preserve some context
|
" preserve some context
|
||||||
set scrolloff=3
|
set scrolloff=3
|
||||||
" make the cursor a bit easier to follows
|
" make the cursor a bit easier to follows
|
||||||
set cursorline
|
set cursorline
|
||||||
" make search work a bit more like tab completion in bash
|
" make search work a bit more like tab completion in bash
|
||||||
set incsearch
|
set incsearch
|
||||||
set wildmode=longest:full
|
set wildmode=longest:full
|
||||||
set wildmenu
|
set wildmenu
|
||||||
" line break handling
|
" line break handling
|
||||||
set linebreak
|
set linebreak
|
||||||
set showbreak=+
|
set showbreak=+
|
||||||
" always on status line
|
" always on status line
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
|
|
||||||
" let backspace work more naturally
|
" let backspace work more naturally
|
||||||
set backspace=start,indent,eol
|
set backspace=start,indent,eol
|
||||||
" favor modern encoding
|
" favor modern encoding
|
||||||
set enc=utf-8
|
set enc=utf-8
|
||||||
" more readable config for list mode
|
" more readable config for list mode
|
||||||
set listchars+=nbsp:¬,tab:»·,trail:·
|
set listchars+=nbsp:¬,tab:»·,trail:·
|
||||||
set listchars-=eol:$
|
set listchars-=eol:$
|
||||||
" smarter handling of case during search
|
" smarter handling of case during search
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
" disable outdated data loss protections
|
" centralize swap to have backup without clutter
|
||||||
" set nobackup
|
set directory=$HOME/.var/nvim/swp//
|
||||||
" set noswapfile
|
" make pastemode more accessible
|
||||||
set directory=$HOME/.var/nvim/swp//
|
set pastetoggle=<F2>
|
||||||
" make pastemode more accessible
|
" save when moving away
|
||||||
set pastetoggle=<F2>
|
au FocusLost * :wa
|
||||||
" save when moving away
|
|
||||||
au FocusLost * :wa
|
|
||||||
|
|
||||||
" make sure to set TERM to xterm-256color in terminal program or app
|
" make sure to set TERM to xterm-256color in terminal program or app
|
||||||
colorscheme breezy
|
colorscheme breezy
|
||||||
set background=light
|
set background=light
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
" ensure autoread works, to detect file changes outside the editor
|
" ensure autoread works, to detect file changes outside the editor
|
||||||
set autoread
|
set autoread
|
||||||
au CursorHold * checktime
|
au CursorHold * checktime
|
||||||
|
|
||||||
" for gui, make it easier to tell different instances apart
|
" for gui, make it easier to tell different instances apart
|
||||||
set title
|
set title
|
||||||
|
|
||||||
" keep nvim from resetting font back to default from terminal config
|
" keep nvim from resetting font back to default from terminal config
|
||||||
set guicursor=
|
set guicursor=
|
||||||
|
|
||||||
set guioptions-=r
|
set guioptions-=r
|
||||||
set guioptions-=b
|
set guioptions-=b
|
||||||
set guioptions-=T
|
set guioptions-=T
|
||||||
set guioptions-=m
|
set guioptions-=m
|
||||||
|
|
||||||
set gfn=DejaVu\ Sans\ Mono\ for\ Powerline:h13
|
set gfn=DejaVu\ Sans\ Mono\ for\ Powerline:h13
|
||||||
" from https://stackoverflow.com/a/51424640
|
" from https://stackoverflow.com/a/51424640
|
||||||
let s:fontsize = 13
|
let s:fontsize = 13
|
||||||
function! AdjustFontSize(amount)
|
function! AdjustFontSize(amount)
|
||||||
let s:fontsize = s:fontsize+a:amount
|
let s:fontsize = s:fontsize+a:amount
|
||||||
:execute "set gfn=DejaVu\\ Sans\\ Mono\\ for\\ Powerline:h" . s:fontsize
|
:execute "set gfn=DejaVu\\ Sans\\ Mono\\ for\\ Powerline:h" . s:fontsize
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
noremap <C-Up> :call AdjustFontSize(1)<CR>
|
noremap <C-Up> :call AdjustFontSize(1)<CR>
|
||||||
noremap <C-Down> :call AdjustFontSize(-1)<CR>
|
noremap <C-Down> :call AdjustFontSize(-1)<CR>
|
||||||
inoremap <C-Up> <Esc>:call AdjustFontSize(1)<CR>a
|
inoremap <C-Up> <Esc>:call AdjustFontSize(1)<CR>a
|
||||||
inoremap <C-Down> <Esc>:call AdjustFontSize(-1)<CR>a
|
inoremap <C-Down> <Esc>:call AdjustFontSize(-1)<CR>a
|
||||||
|
|
||||||
" widen the default display of the taskwarrior plugin to make the description
|
" override the default location of vimwiki and change to markdown
|
||||||
" wrap less
|
let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}]
|
||||||
let g:task_rc_override = 'rc.defaultwidth=120'
|
let g:vimwiki_dir_link = 'index'
|
||||||
|
|
||||||
" override the default location of vimwiki and change to markdown
|
|
||||||
let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}]
|
|
||||||
let g:vimwiki_dir_link = 'index'
|
|
||||||
endif
|
|
||||||
|
|
Loading…
Reference in a new issue