Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created August 21, 2025 10:36
Show Gist options
  • Save mpickering/6eaf7df320be0a4e98cf6595b06aaa1a to your computer and use it in GitHub Desktop.
Save mpickering/6eaf7df320be0a4e98cf6595b06aaa1a to your computer and use it in GitHub Desktop.
set background=dark
set hidden
set wildmenu
nnoremap ' `
nnoremap ` '
map <silent> tu :call GHC_BrowseAll()<CR>
syntax on
set ruler
set nu
set mouse=a
set nofoldenable
set history=1000
set ignorecase
set title
set scrolloff=5
set backupdir=~/.cache/vim,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-temp,~/.tmp,~/tmp,/var/tmp,/tmp
set expandtab
set backspace=2
set tabstop=2
set shiftwidth=2
set inccommand=nosplit
set maxmempattern=2000000
set colorcolumn=80
colorscheme vim
set grepprg="git grep $*"
highlight ExtraWhitespace ctermbg=white guibg=white
match ExtraWhitespace /\s\+$/
highlight FoldColumn guibg=gray14 guifg=white
map <F12> :tabn <CR>
map <F11> :tabp <CR>
" Whitespace
function! Preserve(cmd)
" Prep: save last search + cursor position
let _s=@/
let l = line(".")
let c = col(".")
" Execute command
silent execute a:cmd
" Clean up: restore last search + cursor position
let @/=_s
call cursor(l, c)
endfunction
function! TrimWhitespace()
call Preserve("%s/\\s\\+$//e")
endfunction
function! Indent()
call Preserve('normal gg=G')
endfunction
autocmd BufWritePre * :call TrimWhitespace()
autocmd FileWritePre * :call TrimWhitespace()
autocmd FilterWritePre * :call TrimWhitespace()
autocmd FileAppendPre * :call TrimWhitespace()
" " Type Lookup
map <silent> tt :GhcModType<CR>
nnoremap <silent><Leader><C-]> <C-w><C-]><C-w>T
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
let g:syntastic_disabled_filetypes=['idr', 'hs']
let g:LanguageClient_serverCommands = {
\ 'haskell': ['/home/matt/ghc/hie-wrapper'],
\ }
nnoremap <F5> :call LanguageClient_contextMenu()
let g:LanguageClient_serverStderr = '/tmp/hie-stderr'
let g:LanguageClient_autoStart = 0
function! HandleWindowProgress(params) abort
echomsg json_encode(a:params)
endfunction
let g:LanguageClient_loggingFile = '/tmp/ls-log'
self: super: {
neovim-with-packages =
super.neovim.override {
vimAlias = true;
configure = {
customRC = builtins.readFile ./nix-vimrc ;
packages.myVimPackage = with super.vimPlugins; {
start = [ fzf-vim
#syntastic
vim-nix #LanguageClient-neovim
# LanguageClient-neovim deoplete-nvim fzfWrapper ]
]
;
opt = [];
};
};};
mkHaskellShell = tools: drv: drv.env.overrideAttrs
(oldAttrs : {buildInputs = oldAttrs.buildInputs ++ tools; });
nur = self.callPackage (import (builtins.fetchGit {
url = "https://github.com/nix-community/Nur";
})) {};
ghc-head-from = self.nur.repos.mpickering.ghc-head-from;
qgis-with-progs = super.callPackage ./qgis.nix {};
tracy = import ./tracy.nix;
ghcs-nix = import /home/matt/ghcs-nix;
kimai = self.haskellPackages.callCabal2nix "kimai-client" ./kimai-client { };
eventlog2html = (import (builtins.fetchTarball { url = "https://github.com/mpickering/eventlog2html/archive/e959fdf879c2b404a9843d962b726af499b27cb8.tar.gz";} ) {}).eventlog2html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment