dots/src/.config/nvim/init.vim

111 lines
2.5 KiB
VimL
Raw Normal View History

2023-04-30 12:56:57 -04:00
set tabstop=4 shiftwidth=4 noexpandtab ai nosmd ignorecase smartcase
" terminal settings
" disable line numbers
au TermOpen * setlocal nonumber norelativenumber
" make ESC go to normal mode
tnoremap <silent> <esc> <c-\><c-n><c-\><c-n>
2023-04-30 12:56:57 -04:00
" sign column on top of the line number (gutter for things like breakpoints, warnings)
set scl=number
" enable line numbers
set number relativenumber
" disable bottom right status line
set noruler
set showtabline=0
2023-04-30 12:56:57 -04:00
" performance?
2022-07-04 21:39:27 -04:00
set lazyredraw nocursorline ttyfast
2023-04-30 12:56:57 -04:00
let mapleader = ","
2022-12-10 11:45:48 -05:00
2023-07-03 19:02:56 -04:00
" " use system clipboard instead of internal
" set clipboard=unnamedplus
" " when using c or s, do not overwrite clipboard
" nnoremap c "-c
" vnoremap c "-c
" nnoremap s "-s
" vnoremap s "-s
" easier binds to use system clipboard with
nnoremap <leader>cy "+yy
vnoremap <leader>cy "+y
vnoremap <leader>cd "+d
nnoremap <leader>cd "+dd
nnoremap <leader>cp "+p
nnoremap <leader>cP "+P
2022-12-10 11:45:48 -05:00
set shell=/bin/sh
2021-07-26 09:32:48 -04:00
hi Search cterm=NONE ctermfg=white ctermbg=blue
hi StatusLine ctermbg=NONE cterm=italic
2023-04-12 18:19:11 -04:00
hi SignColumn ctermbg=NONE
autocmd InsertEnter * hi StatusLine cterm=bold
autocmd InsertLeave * hi StatusLine cterm=italic
2021-07-26 09:32:48 -04:00
2021-06-19 15:50:50 -04:00
highlight LineNr ctermfg=grey
2022-07-01 18:18:55 -04:00
" Disable highlighting when searching
2022-07-05 17:28:32 -04:00
nnoremap <silent> <esc> :noh<return><esc>
2022-06-28 21:14:41 -04:00
" shortcuts to type symbols easier
source $XDG_CONFIG_HOME/nvim/digraphs.vim
" tab, window management
set splitbelow splitright
nnoremap <C-j> <C-w>w
nnoremap <C-k> <C-w>W
nnoremap <silent> <C-h> :vertical resize -5<cr>
nnoremap <silent> <C-l> :vertical resize +5<cr>
" exit all (akin to ZZ, ZQ)
nnoremap <silent> ZF :qa<cr>
" copy URL under cursor to clipboard bind
:nnoremap <silent><leader>uu :let @+ = expand('<cfile>')<CR>
2022-12-10 11:45:48 -05:00
" Plugins
2023-01-12 18:18:34 -05:00
" Run PlugInstall if there are missing plugins
if $SYSTEM_PROFILE == "DEFAULT"
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
endif
2023-02-14 19:16:14 -05:00
" The rest will not be sourced if the system is on minimal settings.
if $SYSTEM_PROFILE == "MINIMAL"
finish
endif
2023-01-12 18:18:34 -05:00
2022-12-10 11:45:48 -05:00
call plug#begin()
filetype plugin indent on
" i don't use LaTeX anymore, but you can uncomment this to
"source $XDG_CONFIG_HOME/nvim/vimtex.vim
source $XDG_CONFIG_HOME/nvim/ultisnips.vim
2023-04-12 18:19:11 -04:00
if $SYSTEM_PROFILE == "DEFAULT"
" notes and documents stuff
source $XDG_CONFIG_HOME/nvim/typst.vim
2023-04-12 18:49:17 -04:00
" plugins for IDE-like nvim
source $XDG_CONFIG_HOME/nvim/coding.vim
endif
2023-01-21 21:46:35 -05:00
2023-05-13 12:20:02 -04:00
" URL motions
Plug 'axieax/urlview.nvim'
Plug 'ledger/vim-ledger'
2022-12-10 11:45:48 -05:00
call plug#end()
2023-01-21 21:46:35 -05:00
if $SYSTEM_PROFILE == "DEFAULT"
" see .config/nvim/lua/init.lua
lua require('init')
endif