Add stuff to neovim

This commit is contained in:
Oystein Kristoffer Tveit 2021-12-23 04:36:22 +01:00
parent 60158b4c81
commit 8749a26982
1 changed files with 54 additions and 2 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, home, colorTheme, ... }:
{ pkgs, home, ... }:
{
programs.neovim = {
enable = true;
@ -8,6 +8,7 @@
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
direnv-vim
vim-commentary
vim-gitgutter
fzf-vim
@ -17,7 +18,48 @@
vim-fugitive
vim-css-color
semshi
goyo-vim
{
plugin = goyo-vim;
# TODO: The mapleader definition should be in extraConfig, but setting
# the mapleader before defining keymaps messes things up.
config = ''
let mapleader = " "
let g:goyo_width = '90%'
let g:goyo_height = '85%'
let g:goyo_linenr = 1
function! s:goyo_enter()
if executable('tmux') && strlen($TMUX)
silent !tmux set status off
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
endif
set noshowmode
set noshowcmd
set scrolloff=999
Limelight
" ...
endfunction
function! s:goyo_leave()
if executable('tmux') && strlen($TMUX)
silent !tmux set status on
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
endif
set showmode
set showcmd
set scrolloff=5
Limelight!
" ...
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
nnoremap <leader>z :Goyo<CR>
'';
}
limelight-vim
vim-tmux-navigator
vim-polyglot
@ -46,6 +88,16 @@
extraConfig = ''
set clipboard+=unnamedplus
set number relativenumber
set undofile
set undodir=~/.cache/vim/undodir
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
'';
};