stow/vim/.vimrc

64 lines
1.6 KiB
VimL
Raw Normal View History

2023-12-09 20:20:56 +00:00
set nocompatible
if filereadable(expand('~/.vim/autoload/plug.vim'))
call plug#begin('~/.local/share/vim/plugins')
2023-12-10 16:14:28 +00:00
" Syntax highlighting and language-specific rules
2023-12-09 20:20:56 +00:00
Plug 'sheerun/vim-polyglot'
2023-12-10 16:14:28 +00:00
" Snippets
Plug 'SirVer/ultisnips'
2023-12-09 20:20:56 +00:00
2023-12-10 16:14:28 +00:00
" Web development
2023-12-09 20:20:56 +00:00
Plug 'mattn/emmet-vim'
2023-12-10 16:14:28 +00:00
" Go programming
2023-12-09 20:20:56 +00:00
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
2023-12-10 16:14:28 +00:00
" Zettelkasten support
2023-12-09 20:20:56 +00:00
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug '~/code/zk.vim/'
call plug#end()
2023-12-10 16:14:28 +00:00
" Ultisnips config
let g:UltiSnipsSnippetsDir='~/.local/share/ultisnips'
let g:UltiSnipsSnippetDirectories=['~/.local/share/ultisnips']
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsEditSplit="context"
else
" Make tab = 4 spaces if vim-polyglot can't be loaded
set tabstop=4
set softtabstop=4
set shiftwidth=4
2023-12-09 20:20:56 +00:00
endif
2024-07-26 12:19:34 +00:00
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" a little more informative version of the above
nmap <C-P> :call <SID>SynStack()<CR>
2023-12-10 16:14:28 +00:00
" Autocommands
autocmd BufEnter ~/.local/share/zk/* set filetype=markdown
" Enable line-numbering
2023-12-09 20:20:56 +00:00
set number
set relativenumber
2023-12-10 16:14:28 +00:00
" Use swap directory instead of cluttering source directories with swapfiles
set directory^=$HOME/.vim/swap//
" Use system clipboard by default
set clipboard=unnamedplus
" Make file searching better
set wildmenu
set wildmode=list:full
set path+=**