1
0
Fork 0

helix 22.12

This commit is contained in:
Malte 2022-12-08 00:00:18 +01:00
parent 8e448a3122
commit f476342cca
6 changed files with 6 additions and 388 deletions

View file

@ -10,7 +10,6 @@
../../common
./unlock.nix
./mpclient.nix
./neovim
./helix.nix
./nvd.nix
];

View file

@ -67,6 +67,8 @@ in {
indent-guides.render = true;
cursorline = true;
color-modes = true;
bufferline = "multiple";
auto-save = true;
};
};
languages = [

View file

@ -1,121 +0,0 @@
{
pkgs,
config,
...
}: let
cocSettings = {
"diagnostic.maxWindowHeight" = 60;
"diagnostic.virtualText" = true;
"diagnostic.virtualTextCurrentLineOnly" = false;
"codeLens.enable" = true;
languageserver = {
haskell = {
command = "haskell-language-server";
args = ["--lsp" "-d" "-l" "/tmp/LanguageServer.log"];
rootPatterns = [".hie-bios" "cabal.project"];
filetypes = ["hs" "lhs" "haskell"];
settings.languageServerHaskell.formattingProvider = "fourmolu";
};
};
explorer.icon.enableNerdfont = true;
explorer.file.child.template = "[git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][diagnosticWarning & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]";
};
in {
imports = [./spelling.nix];
programs.neovim = {
enable = true;
vimAlias = true;
vimdiffAlias = true;
extraConfig = builtins.readFile ./vimrc;
plugins = builtins.attrValues {
inherit
(pkgs.vimPlugins)
# coc-tabnine (TODO: Why doesnt it work?)
# TODO: tabnine config in home-manager
# TODO: tabnine lsp: nix, rust, pandoc/latex lsp? was noch?
# ===
# Basic IDE plugins
coc-nvim
airline
# same word highlighting when not supported by language
coc-highlight
coc-explorer
# searches
coc-fzf
fzf-vim
# general whitespace
vim-trailing-whitespace
vim-autoformat
# Git
coc-git
# statusline, numberline and explorer infos
fugitive
# various git commands
# Commenting and Uncommenting
nerdcommenter
# Theme
papercolor-theme
vim-airline-themes
LanguageTool-nvim
vim-css-color
vista-vim
# ===
# Languages
# haskell syntax highlighting
haskell-vim
vim-hoogle
# nix syntax highlighting
vim-nix
vim-markdown
# latex
vimtex
coc-vimtex
# not sure if I need two
# ledger
vim-ledger
# rust
coc-rls
# python
coc-python
# css
coc-css
# yaml
coc-yaml
# json
coc-json
# html
coc-html
# dhall
dhall-vim
;
};
};
xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON cocSettings;
}

View file

@ -1,26 +0,0 @@
{config, ...}: let
nvim-spell-de-utf8-dictionary = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl";
sha256 = "1ld3hgv1kpdrl4fjc1wwxgk4v74k8lmbkpi1x7dnr19rldz11ivk";
};
nvim-spell-de-utf8-suggestions = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.sug";
sha256 = "0j592ibsias7prm1r3dsz7la04ss5bmsba6l1kv9xn3353wyrl0k";
};
nvim-spell-de-latin1-dictionary = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/de.latin1.spl";
sha256 = "0hn303snzwmzf6fabfk777cgnpqdvqs4p6py6jjm58hdqgwm9rw9";
};
nvim-spell-de-latin1-suggestions = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/de.latin1.sug";
sha256 = "0mz07d0a68fhxl9vmy1548vnbayvwv1pc24zhva9klgi84gssgwm";
};
in {
home.file."${config.xdg.configHome}/nvim/spell/de.utf-8.spl".source = nvim-spell-de-utf8-dictionary;
home.file."${config.xdg.configHome}/nvim/spell/de.utf-8.sug".source = nvim-spell-de-utf8-suggestions;
home.file."${config.xdg.configHome}/nvim/spell/de.latin1.spl".source = nvim-spell-de-latin1-dictionary;
home.file."${config.xdg.configHome}/nvim/spell/de.latin1.sug".source = nvim-spell-de-latin1-suggestions;
}

View file

@ -1,236 +0,0 @@
set spell spelllang=de,en
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#nvimlsp#enabled = 0
let g:tex_flavor = 'latex'
function! MyExplorer()
if &filetype == 'coc-explorer'
wincmd w
else
CocCommand explorer --no-toggle
endif
endfunction
no <space>e :call MyExplorer()<CR>
no <space>v :Vista coc<CR>
set nofoldenable
set background=light
set autoindent
set nosmartindent
set listchars=tab:»\ ,trail:.,extends:#
set list
set ts=3
set number
set scrolloff=5
set sidescrolloff=5
set laststatus=2
set incsearch
set mouse=
set showcmd
set title
" Set this here so that nothing gets overriden later
filetype plugin indent on
syntax on
set undodir=~/.vimhist/
set undofile
set undolevels=100
set undoreload=1000
augroup focus
au!
au TabLeave * silent! wall
au FocusLost * silent! wall
au BufLeave * silent! wall
augroup END
no <silent><cr> :nohlsearch<CR>
vno < <gv
vno > >gv
no <c-down> <c-w><c-j>
no <c-up> <c-w><c-k>
no <c-right> <c-w><c-l>
no <c-left> <c-w><c-h>
let mapleader=","
set winaltkeys=no
set noai
set cursorline
set cursorcolumn
set si
set expandtab
set sw=3
set pt=<F4>
set ignorecase
set wildmenu
set hlsearch
no <buffer> <silent> <Up> gk
no <buffer> <silent> <Down> gj
no <buffer> <silent> <Home> g<Home>
no <buffer> <silent> <End> g<End>
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
let g:formatdef_my_cabal = '"cabal-fmt"'
let g:formatters_cabal = ['my_cabal']
let g:formatdef_my_nix = '"nixfmt"'
let g:formatters_nix = ['my_nix']
let g:formatdef_my_dhall = '"dhall format"'
let g:formatters_dhall = ['my_dhall']
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:languagetool_server_command = "languagetool-http-server"
colorscheme PaperColor
highlight CursorColumn ctermbg=8
highlight CursorLine ctermbg=8
" if hidden is not set, TextEdit might fail.
set hidden
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
ino <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
ino <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
ino <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
ino <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
no <silent> gp :call CocAction('diagnosticPrevious')<cr>
no <silent> gn :call CocAction('diagnosticNext')<cr>
" Remap keys for gotos
no <silent> gd :call CocAction('jumpDefinition')<cr>
no <silent> gt :call CocAction('jumpTypeDefinition')<cr>
no <silent> gr :call CocAction('jumpReferences')<cr>
no <silent> gs :Git status<CR>
no <silent> gu :CocCommand git.chunkUndo<CR>
no <silent> gi :CocCommand git.chunkInfo<CR>
no <silent> ga :CocCommand git.chunkStage<CR>
no <silent> gb :CocCommand git.showCommit<CR>
no <silent> gc :Git commit<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
elseif (coc#rpc#ready())
call CocActionAsync('definitionHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
no <silent> <space>i :call <SID>show_documentation()<CR>
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
no <silent> <space>f :call CocAction('format')<cr>
no <silent> <space>l :call CocAction('codeLensAction')<cr>
" FZF ctrl-p style search
no <space>p :Files<CR>
no <space>g :Rg<CR>
no <space>h :History<CR>
no <space>b :Buffers<CR>
function MyClose()
if &readonly
quit
else
write
quit
endif
endfunction
function MyCloseAll()
if &readonly
quitall
else
wall
quitall
endif
endfunction
no <space>q :call MyClose()<CR>
no <space>k :call MyCloseAll()<CR>
no <space>s :w<CR>
no <a-left> :bp<CR>
no <a-right> :bn<CR>
ino <a-left> <ESC>:bp<CR>
ino <a-right> <ESC>:bn<CR>
" Use <tab> for select selections ranges, needs server support, like: coc-tsserver, coc-python
no <silent> <TAB> <Plug>(coc-range-select)
xno <silent> <TAB> <Plug>(coc-range-select)
xno <silent> <S-TAB> <Plug>(coc-range-select-backword)
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" use `:OR` for organize import of current buffer
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
ino <ESC>[1~ <HOME>
ino <ESC>[4~ <End>
" Using CocList
" Show all diagnostics
no <silent> <space>d :<C-u>CocFzfList diagnostics<cr>
" Show commands
no <silent> <space>c :<C-u>CocFzfList commands<cr>
" Find symbol of current document
no <silent> <space>o :Vista finder coc<cr>
" Find symbol of current document
no <silent> <space>a :<C-u>CocAction<cr>
ino <Enter> <CR>
" Load this after theme
hi Normal ctermbg=NONE

View file

@ -86,15 +86,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixos-unstable": {
"branch": "nixos-unstable",
"branch": "71a7e0ea4ebaedf330bfdfe7261ab2b93a868a6c",
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",
"homepage": null,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e51c97f1c849efdfd4f3b78a4870e6aa2da4198",
"sha256": "0d0alwdd07lsy4jl29wgn0m1z17ah9rwwggh7kpvg7a7skny24lc",
"rev": "71a7e0ea4ebaedf330bfdfe7261ab2b93a868a6c",
"sha256": "0jxg2qj5zn5v4krd6z14spb7kgfs3vn9vglm7v88gfxcp1jjhzs3",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/6e51c97f1c849efdfd4f3b78a4870e6aa2da4198.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/71a7e0ea4ebaedf330bfdfe7261ab2b93a868a6c.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-bot": {