summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorZofia Szweda <sophies@disroot.org>2026-09-12 13:33:59 +0200
committerZofia Szweda <sophies@disroot.org>2026-09-12 13:33:59 +0200
commit0eb093a19619c57eaac3323d34033778bf201f31 (patch)
treee7dc964bfcff17343683a270aae71796909e0c4b /vim
parenta2f848cc9c5c0bc9fb32cef1a7a8a4d2be462a54 (diff)
vim: temp surround config, fix later
Diffstat (limited to 'vim')
-rw-r--r--vim/.vimrc45
1 files changed, 34 insertions, 11 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index 58ab2a3..4c8aa74 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -2,6 +2,7 @@ if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
+
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'rafi/awesome-vim-colorschemes'
@@ -15,15 +16,18 @@ Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-commentary'
Plug 'yegappan/lsp'
Plug 'dense-analysis/ale'
+Plug 'tpope/vim-surround'
+Plug 'tpope/vim-repeat'
+Plug 'andymass/vim-matchup'
Plug 'kalbasit/vim-colemak'
call plug#end()
let mapleader = "\<Space>"
-syntax on
-"filetype
+syntax on
+
filetype on
filetype indent on
filetype plugin on
-"set
+
set updatetime=300
set completeopt=menuone,popup,noinsert,noselect
set scrolloff=5 " same as helix's scrolloff
@@ -40,7 +44,7 @@ set relativenumber
set expandtab
set tabstop=4
set shiftwidth=4
-set smarttab
+set smarttab
set smartindent
set noswapfile
set incsearch
@@ -60,12 +64,18 @@ set signcolumn=yes
set shortmess+=c
" etc
colorscheme carbonized-dark
-" colorscheme flatwhite
+augroup colors_whichkey
+ autocmd!
+autocmd FileType which_key highlight WhichKey guifg=#88C0D0 gui=bold
+autocmd FileType which_key highlight WhichKeySeperator guifg=#4C566A
+autocmd FileType which_key highlight WhichKeyGroup guifg=#EBCB8B gui=bold
+autocmd FileType which_key highlight WhichKeyDesc guifg=#ECEFF4
+augroup END
+
nnoremap <Space> <Nop>
nnoremap <silent> <leader> :WhichKey '<Space>'<CR>
inoremap <silent> <Esc> <Esc>l
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
-"let
function! Oxlint_fix(buffer) abort
return {
\ 'command': 'oxlint --fix --stdin --stdin-filename %s < %t'
@@ -91,15 +101,16 @@ let g:ale_sign_column_always = 1
let g:lsp_settings_filetype_markdown = []
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
+
let g:buftabline_show = 2
let g:buftabline_numbers = 1
+
let g:user_emmet_leader_key='<Space>'
let g:user_emmet_mode='n'
let g:user_emmet_install_global = 0
-" let g:lightline = {
-" \ 'colorscheme': 'PaperColor',
-" \ 'background': 'dark',
-" \ }
+
+let g:surround_no_mappings = 1
+
let g:which_key_map = {}
let g:which_key_map.f = ['Files', 'file buffer']
let g:which_key_map.b = {
@@ -108,9 +119,22 @@ let g:which_key_map.b = {
\ 'p' : ['bp', 'previous buffer'],
\ 'b' : ['Buffers', 'fuzzy find buffers'],
\ }
+
+nmap <leader>sa <Plug>Ysurround
+nmap <leader>saa <Plug>Yssurround
+nmap <leader>sc <Plug>Csurround
+nmap <leader>sd <Plug>Dsurround
+xmap <leader>s <Plug>VSurround
+
+let g:which_key_map.s = { 'name' : '+surround' }
+let g:which_key_map.s.a = 'add surround'
+let g:which_key_map.s.aa = 'add surround (line)'
+let g:which_key_map.s.c = 'change surround'
+let g:which_key_map.s.d = 'delete surround'
call which_key#register('<Space>', 'g:which_key_map')
augroup lsp
+ autocmd!
autocmd User LspSetup call LspOptionsSet(#{
\ autoComplete: v:true,
\ autoHighlightDiags: v:true,
@@ -149,4 +173,3 @@ function! s:lsp_keymaps() abort
endfunction
augroup END
-