adding vim or something

This commit is contained in:
2026-09-29 13:57:38 +01:00
parent b708a82046
commit 450f48bc0a
2 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
{
inputs,
moduleWithSystem,
...
}: {
flake.nixosModules.vim = moduleWithSystem ({pkgs, ...}: let
modules = [];
in {});
perSystem = {pkgs, ...}: {
packages.vim = inputs.wrappers.wrappers.vim.wrap {
inherit pkgs;
plugins = with pkgs.vimPlugins; [
# vim-lsp
# vim-lsp-settings
# asyncomplete-vim
# asyncomplete-lsp-vim
ale
];
vimrc = builtins.readFile ./vimrc;
};
};
}

View File

@@ -0,0 +1,62 @@
" Set colorscheme and enable highlighting
colorscheme catppuccin
set termguicolors
syntax on
" Set tab stuff
set tabstop=2
set shiftwidth=2
set expandtab
set softtabstop=2
" Enable line numbers
set number
set relativenumber
set cursorline
" Make cursorlinenum a different color
augroup colorAutoCmds
autocmd!
autocmd ColorScheme * highlight CursorLineNr cterm=bold guifg=#cba6f7
augroup END
set ignorecase
set smartcase
set hlsearch
set incsearch
" Set different cursor shapes depending on mode
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
augroup cursorCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
augroup END
" Completion menu
"inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
"inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
set omnifunc=ale#completion#OmniFunc
nnoremap K <cmd>ALEHover<CR>
nnoremap <leader>gd <cmd>ALEGoToDefinition<CR>
nnoremap <leader>gr <cmd>ALEFindReferences<CR>
nnoremap <leader>ca <cmd>ALECodeAc
let g:ale_completion_enabled = 1
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'nixd',
\ 'cmd': ['nixd'],
\ 'allowlist': ['nix'],
\ })
let g:ale_linters = {
\ 'nix': ['nixd'],
\}
let g:ale_fixers = {
\ 'nix': ['alejandra'],
\}
let g:ale_fix_on_save = 1