Get rid of neomutt and neovim

This commit is contained in:
Charlotte Van Petegem 2021-03-20 21:29:18 +01:00
parent afa2c88f6a
commit 18ec940162
No known key found for this signature in database
GPG key ID: 019E764B7184435A
13 changed files with 10 additions and 3158 deletions

View file

@ -12,7 +12,6 @@
./global-mailer.nix
./gomuks.nix
./minecraft.nix
./neovim.nix
./nix.nix
./nginx.nix
./ovh.nix

View file

@ -22,9 +22,12 @@
];
};
};
home.file = {
".emacs.d/early-init.el".source = ./emacs/early-init.el;
".emacs.d/init.el".source = ./emacs/init.el;
home = {
file = {
".emacs.d/early-init.el".source = ./emacs/early-init.el;
".emacs.d/init.el".source = ./emacs/init.el;
};
sessionVariables = { EDITOR = "emacs"; };
};
};
};

View file

@ -1,216 +0,0 @@
{ config, lib, pkgs, ... }:
let
customPlugins = {
snow-color-theme = pkgs.vimUtils.buildVimPlugin {
name = "snow";
src = pkgs.fetchFromGitHub {
owner = "nightsense";
repo = "snow";
rev = "f9800e987e404efed4748fe8098e04ddbec9770b";
sha256 = "099fky1bpppac5785bhx1jc26gfpm8n837p8487j1rf1lwq83q33";
};
};
};
jdtls = import ../packages/jdtls/default.nix { inherit pkgs; stdenv = pkgs.stdenv; };
kotlinls = import ../packages/kotlin-language-server/default.nix { inherit pkgs; };
base = home: {
home.sessionVariables = { EDITOR = "nvim"; };
programs.neovim = {
enable = true;
extraConfig = ''
set autoread
"" Theming
set termguicolors
set background=light
colorscheme snow
"" General settings
" Undo over sessions
set undofile
set undodir=${config.chvp.cachePrefix}${home}/.cache/nvim/undo
" Automatically save sessions on exit and load them on start
function! MakeSession()
let b:sessiondir = "${config.chvp.cachePrefix}${home}/.local/share/nvim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
function! LoadSession()
let b:sessiondir = "${config.chvp.cachePrefix}${home}/.local/share/nvim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
endfunction
if(argc() == 0)
au VimEnter * nested :call LoadSession()
au VimLeave * :call MakeSession()
endif
"" Filetype configuration
" Base settings for all files
syntax enable
set number
set showcmd
set scrolloff=8
set expandtab
set tabstop=4
set shiftwidth=4
set linebreak
set list
set listchars=tab:·\ ,trail:·
set inccommand=split
set clipboard=unnamedplus
filetype plugin indent on
"" Fuzzy search in vim
function! s:completedFiles(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
exe ':e ' . lines[0]
endif
call delete(a:filename)
endif
endfunction
function! FzyFiles()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --files --hidden -g '!/.git' --smart-case | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedFiles', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
function! s:completedGrep(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
let list = split(lines[0], ':')
let file = list[0]
let line = list[1]
exe ':e ' . file
exe line
endif
call delete(a:filename)
endif
endfunction
function! FzyGrep()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --vimgrep --hidden -g '!/.git' '^' | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedGrep', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
nnoremap <C-f> :call FzyFiles()<CR>
nnoremap <C-g> :call FzyGrep()<CR>
'';
plugins = with pkgs.vimPlugins // customPlugins; [
{
plugin = ale;
config = ''
let g:ale_fix_on_save = 1
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
'' + (lib.optionalString config.chvp.graphical ''
\ 'javascript': ['eslint', 'remove_trailing_lines', 'trim_whitespace'],
\ 'ledger': ['trim_whitespace'],
\ 'nix': ['nixpkgs-fmt', 'remove_trailing_lines', 'trim_whitespace'],
\ 'ruby': ['rubocop', 'remove_trailing_lines', 'trim_whitespace'],
\ 'typescript': ['eslint', 'remove_trailing_lines', 'trim_whitespace'],
\ 'vue': ['prettier', 'remove_trailing_lines', 'trim_whitespace'],
'') + ''
\}
'';
}
auto-pairs
{
plugin = deoplete-nvim;
config = ''
let g:deoplete#enable_at_startup = 1
set completeopt+=noselect
'' + lib.optionalString config.chvp.graphical ''
au VimEnter * call deoplete#custom#option('omni_patterns', {
\ 'ledger': ['[a-zA-Z][a-zA-Z: ]*'],
\})
'';
}
editorconfig-vim
snow-color-theme
vim-nix
] ++ lib.optionals config.chvp.graphical [
kotlin-vim
{
plugin = LanguageClient-neovim;
config = ''
" Required for operations modifying multiple buffers like rename
set hidden
let g:LanguageClient_serverCommands = {
\ 'java': ['${jdtls}/bin/jdtls'],
\ 'javascript': ['${pkgs.nodePackages.javascript-typescript-langserver}/bin/javascript-typescript-stdio'],
\ 'kotlin': ['${kotlinls}/bin/kotlin-language-server'],
\ 'ruby': ['${pkgs.solargraph}/bin/solargraph', 'stdio'],
\ 'typescript': ['${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server', '--stdio'],
\ 'vue': ['${pkgs.nodePackages.vue-language-server}/bin/vls'],
\ }
function LC_maps()
if has_key(g:LanguageClient_serverCommands, &filetype)
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
endif
endfunction
autocmd FileType * call LC_maps()
'';
}
vim-ledger
vim-ruby
vim-vue
yats-vim
];
extraPackages = with pkgs; [
nixpkgs-fmt
];
};
};
in
{
options.chvp.neovim = {
enable = lib.mkOption {
default = true;
example = false;
};
};
config = lib.mkIf config.chvp.neovim.enable {
home-manager.users.charlotte = { ... }: (base "/home/charlotte");
home-manager.users.root = { ... }: (base "/root");
};
}

View file

@ -13,7 +13,6 @@ let
set -sg escape-time 10
'';
keyMode = "vi";
tmuxinator.enable = lib.mkIf config.chvp.graphical true;
};
};
in
@ -24,13 +23,7 @@ in
};
config = lib.mkIf config.chvp.tmux.enable {
home-manager.users.charlotte = { ... }: base // lib.optionalAttrs config.chvp.graphical {
xdg.configFile = {
"tmuxinator/accentor.yml".source = ./tmux/accentor.yml;
"tmuxinator/dodona.yml".source = ./tmux/dodona.yml;
"tmuxinator/mail.yml".source = ./tmux/mail.yml;
};
};
home-manager.users.charlotte = { ... }: base;
home-manager.users.root = { ... }: base;
};
}

View file

@ -1,36 +0,0 @@
name: accentor
project_root: "/home/charlotte/repos/accentor"
windows:
- api:
root: "/home/charlotte/repos/accentor/api"
layout: main-vertical
panes:
- nvim
- git status
- web:
root: "/home/charlotte/repos/accentor/web"
layout: main-vertical
panes:
- nvim
- git status
- android:
root: "/home/charlotte/repos/accentor/android"
layout: main-vertical
panes:
- nvim
- git status
- run:
layout: even-horizontal
panes:
- rails:
- cd api
- bundle exec rails s
- delayed_job:
- cd api
- bundle exec rails jobs:work
- vue:
- cd web
- yarn run serve
- postgres:
- cd api
- start-db

View file

@ -1,55 +0,0 @@
# /home/charlotte/.config/tmuxinator/dodona.yml
name: dodona
root: ~/repos/dodona/dodona
# Optional tmux socket
# socket_name: foo
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.
# Project hooks
# Runs on project start, always
# on_project_start: command
# Run on project start, the first time
# on_project_first_start: command
# Run on project start, after the first time
# on_project_restart: command
# Run on project exit ( detaching from tmux session )
# on_project_exit: command
# Run on project stop
# on_project_stop: command
# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247
# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf
# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor
# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1
# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false
windows:
- editor:
layout: main-vertical
panes:
- nvim
- git status
- server:
layout: even-horizontal
panes:
- bundle exec rails s
- bundle exec rails jobs:work
- ./bin/webpack-dev-server
- logs: tail -f log/development.log
- db: start-dockers

View file

@ -1,47 +0,0 @@
# /home/charlotte/.config/tmuxinator/mail.yml
name: mail
root: ~/mail
# Optional tmux socket
# socket_name: foo
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.
# Project hooks
# Runs on project start, always
# on_project_start: command
# Run on project start, the first time
# on_project_first_start: command
# Run on project start, after the first time
# on_project_restart: command
# Run on project exit ( detaching from tmux session )
# on_project_exit: command
# Run on project stop
# on_project_stop: command
# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247
# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf
# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor
# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1
# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false
windows:
- main:
layout: main-vertical
panes:
- neomutt
- khal interactive