vim (again)
This commit is contained in:
parent
89351c74a6
commit
bf944127c6
1 changed files with 78 additions and 7 deletions
|
|
@ -5,7 +5,10 @@
|
||||||
username = "coyote";
|
username = "coyote";
|
||||||
homeDirectory = "/home/coyote";
|
homeDirectory = "/home/coyote";
|
||||||
shell.enableShellIntegration = true;
|
shell.enableShellIntegration = true;
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
# devel
|
||||||
|
nodejs
|
||||||
# productivity
|
# productivity
|
||||||
libreoffice-fresh
|
libreoffice-fresh
|
||||||
karp
|
karp
|
||||||
|
|
@ -26,6 +29,12 @@
|
||||||
# emulation
|
# emulation
|
||||||
(unstable.bottles.override { removeWarningPopup = true; })
|
(unstable.bottles.override { removeWarningPopup = true; })
|
||||||
];
|
];
|
||||||
|
|
||||||
|
file.".vim/coc-settings.json".text = builtins.toJSON {
|
||||||
|
"suggest.noselect" = true;
|
||||||
|
"diagnostic.virtualText" = true;
|
||||||
|
"coc.preferences.formatOnSaveFiletypes" = [ "nix" "json" "javascript" "python" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.flatpak = {
|
services.flatpak = {
|
||||||
|
|
@ -37,11 +46,7 @@
|
||||||
];
|
];
|
||||||
overrides = {
|
overrides = {
|
||||||
global = { Context.sockets = ["wayland" "!x11" "!fallback-x11"]; };
|
global = { Context.sockets = ["wayland" "!x11" "!fallback-x11"]; };
|
||||||
settings = {
|
settings.Environment.XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons";
|
||||||
Environment = {
|
|
||||||
XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -79,9 +84,75 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
emacs = {
|
vim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = "-nw";
|
packageConfigurable = pkgs.unstable.vim-full;
|
||||||
|
defaultEditor = true;
|
||||||
|
plugins = with pkgs.vimPlugins.unstable; [
|
||||||
|
indentLine
|
||||||
|
coc-nvim
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
" Vim configuration
|
||||||
|
set nocompatible
|
||||||
|
set encoding=utf-8
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
set mouse=a
|
||||||
|
set history=1000
|
||||||
|
set updatetime=300
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
set ruler
|
||||||
|
set showcmd
|
||||||
|
set showmode
|
||||||
|
set laststatus=2
|
||||||
|
set wildmenu
|
||||||
|
set wildmode=longest,list,full
|
||||||
|
set ttyfast
|
||||||
|
set lazyredraw
|
||||||
|
|
||||||
|
filetype plugin indent on
|
||||||
|
set autoindent
|
||||||
|
set smartindent
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set softtabstop=4
|
||||||
|
set expandtab
|
||||||
|
|
||||||
|
set hlsearch
|
||||||
|
set incsearch
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set showmatch
|
||||||
|
|
||||||
|
" indent guides
|
||||||
|
let g:indentLine_enabled = 1
|
||||||
|
let g:indentLine_char = "|"
|
||||||
|
let g:indentLine_setColors = 1
|
||||||
|
|
||||||
|
" per-language indent settings
|
||||||
|
augroup LanguageSpecificSettings
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType javascript,typescript,html,css,json,nix setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab
|
||||||
|
autocmd FileType python,rust,scheme setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||||
|
autocmd FileType go,make setlocal tabstop=4 shiftwidth=4 noexpandtab
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
" coc.nvim config
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||||
|
\ CheckBackspace() ? "\<Tab>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||||
|
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackspace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
fastfetch = {
|
fastfetch = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Reference in a new issue