feat(ideavim): init

This commit is contained in:
winston 2023-03-10 09:33:11 +01:00
parent bebd7d833b
commit 572626d4c3
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,84 @@
" vim:ft=vim:fenc=utf-8:fdm=marker
""" map leader to <space> ----------------------------------------------------
let mapleader=" "
""" emulated plugins
" use 'c|d|yia' to c|d|y inner arguments
set argtextobj
" enable gcc / gc+motion to toggle comments
set commentary
" jump around text easier, with <space> as leader
set easymotion
" highlight yank. duh.
set highlightedyank
" vim navigation for the dir tree view
set NERDTree
set ReplaceWithRegister
set surround
set textobj-entire
" which-key, yay
set which-key
""" Common settings ----------------------------------------------------------
" '_' is a word separator
set iskeyword-=_
set relativenumber
set number
set showcmd
set showmode
" scroll offset
set scrolloff=5
set sidescrolloff=5
" don't use Ex mode, use Q for formatting.
map Q gq
""" IDEA-specific settings ---------------------------------------------------
set ideamarks
set ideajoin
set ideastatusicon=gray
""" Mappings -----------------------------------------------------------------
" IDEA binds
map <leader>a <Action>(Annotate)
map <leader>b <Action>(ToggleLineBreakpoint)
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
map <leader>rn <Action>(RenameElement)
" plugin binds
map <C-N> :NERDTreeToggle<CR>
" easier split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
sethandler <C-D> a:vim
sethandler <C-U> a:vim
sethandler <C-R> n:ide
map <A-<> <Action>(PreviousTab)
map <A->> <Action>(NextTab)
map <A-c> <Action>(NewScratchFile)
map <A-x> <Action>(CloseContent)
" Zen mode
map <leader>zz <Action>(ToggleZenMode)
" File navigation
map <leader>ff <Action>(GotoFile)
map <leader>fg <Action>(FindInPath)
map <leader>fl <Action>(RecentLocations)
map [d <Action>(GotoPreviousError)
map ]d <Action>(GotoNextError)
map [c <Action>VcsShowPrevChangeMarker
map [c <Action>VcsShowNextChangeMarker
" show hoverdoc
map H <Action>(ShowErrorDescription)

View file

@ -1,5 +1,6 @@
{ {
config, config,
flakePath,
lib, lib,
pkgs, pkgs,
machine, machine,
@ -84,4 +85,6 @@ in {
man.enable = true; man.enable = true;
taskwarrior.enable = true; taskwarrior.enable = true;
}; };
xdg.configFile."ideavim/ideavimrc".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/ideavim/ideavimrc";
} }