restore nvim
This commit is contained in:
parent
3a407a2d6c
commit
7d693a37d3
|
@ -1,3 +1,164 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
customPlugins = {
|
||||
vim-zettel = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "vim-zettel";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "michal-h21";
|
||||
repo = "vim-zettel";
|
||||
rev = "929d90eec62e6f693c2702d2b6f76a93f2f1689d";
|
||||
sha256 = "1fzKmknfVlEYwqeXgbKITbb2/PJ023iJyMz6vak3qh4=";
|
||||
};
|
||||
};
|
||||
lsp-format = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "lsp-format";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lukas-reineke";
|
||||
repo = "lsp-format.nvim";
|
||||
rev = "84e117b99bb2bc0d0c8122e2b256046f046f8aff";
|
||||
sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4=";
|
||||
};
|
||||
};
|
||||
vim-tidal = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
name = "vim-tidal";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/tidalcycles/vim-tidal";
|
||||
# version 1.4.6
|
||||
rev = "52134979252757a5736ae09cb9fc6ae3cc04daef";
|
||||
sha256 = "c12v9+s/JspQ9Am291RFI7eg0UAeXGDvJ5lK+7ukOb0=";
|
||||
};
|
||||
dependencies = [ ];
|
||||
};
|
||||
tidal = pkgs.stdenv.mkDerivation {
|
||||
name = "tidal";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/tidalcycles/vim-tidal";
|
||||
# version 1.4.6
|
||||
rev = "52134979252757a5736ae09cb9fc6ae3cc04daef";
|
||||
sha256 = "c12v9+s/JspQ9Am291RFI7eg0UAeXGDvJ5lK+7ukOb0=";
|
||||
};
|
||||
preConfigure = ''
|
||||
mkdir -p $out/bin
|
||||
substituteInPlace Makefile \
|
||||
--replace '/usr/local' "$out" \
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
my-python-packages = python-packages: with python-packages; [
|
||||
tasklib
|
||||
pynvim
|
||||
six
|
||||
python-lsp-server
|
||||
pylsp-mypy
|
||||
pylint
|
||||
black
|
||||
# other python packages you want
|
||||
];
|
||||
python-with-my-packages = pkgs.python3.withPackages my-python-packages;
|
||||
in
|
||||
{
|
||||
environment.variables.EDITOR = "nvim";
|
||||
environment.shellAliases = {
|
||||
k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD";
|
||||
kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD";
|
||||
};
|
||||
|
||||
#environment.systemPackages = with customPlugins; [ tidal ];
|
||||
home-manager.users.anish.programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
set tabstop=2
|
||||
set showmatch
|
||||
set shiftwidth=2
|
||||
set noexpandtab
|
||||
set autoindent
|
||||
set undofile
|
||||
set signcolumn=auto:4
|
||||
|
||||
" set foldmethod=indent " fold based on indent
|
||||
set number
|
||||
set nocompatible
|
||||
set relativenumber
|
||||
set showtabline=2
|
||||
set noexpandtab
|
||||
set autowriteall
|
||||
syntax on
|
||||
set list lcs=tab:\|\
|
||||
filetype plugin on
|
||||
|
||||
set termguicolors
|
||||
colorscheme ayu-mirage
|
||||
|
||||
" set spell
|
||||
set spelllang=en_gb
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set incsearch
|
||||
" if hidden is not set, TextEdit might fail.
|
||||
set hidden
|
||||
" Some servers have issues with backup files, see #649
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
" Better display for messages
|
||||
set cmdheight=2
|
||||
" 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
|
||||
|
||||
" window
|
||||
nmap <leader>wh :topleft vnew<CR>
|
||||
nmap <leader>wl :botright vnew<CR>
|
||||
nmap <leader>wk :topleft new<CR>
|
||||
nmap <leader>wj :botright new<CR>
|
||||
|
||||
" tabs
|
||||
nmap <leader>rt :retab!<CR>
|
||||
vmap <leader>rt :retab!<CR>
|
||||
|
||||
let mapleader = "\<Space>"
|
||||
let maplocalleader = ","
|
||||
|
||||
" moving splits with vim movements.
|
||||
:tnoremap <A-h> <C-\><C-N><C-w>h
|
||||
:tnoremap <A-j> <C-\><C-N><C-w>j
|
||||
:tnoremap <A-k> <C-\><C-N><C-w>k
|
||||
:tnoremap <A-l> <C-\><C-N><C-w>l
|
||||
:inoremap <A-h> <C-\><C-N><C-w>h
|
||||
:inoremap <A-j> <C-\><C-N><C-w>j
|
||||
:inoremap <A-k> <C-\><C-N><C-w>k
|
||||
:inoremap <A-l> <C-\><C-N><C-w>l
|
||||
:nnoremap <A-h> <leader>h
|
||||
:nnoremap <A-j> <leader>j
|
||||
:nnoremap <A-k> <leader>k
|
||||
:nnoremap <A-l> <leader>l
|
||||
:nnoremap <F5> "=strftime("%Y-%m-%d %H:%M")<CR>
|
||||
:inoremap <F5> <C-R>=strftime("%Y-%m-%d %H:%M")<CR>
|
||||
:inoremap <F4> <C-R>=strftime("%H:%M")<CR>
|
||||
|
||||
" tidal nvim terminal
|
||||
let g:tidal_target = "terminal"
|
||||
|
||||
" telescope
|
||||
" Find files using Telescope command-line sugar.
|
||||
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
||||
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
||||
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
||||
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
||||
nnoremap <leader>ft <cmd>Telescope tags<cr>
|
||||
|
||||
" exit normal mode in terminal
|
||||
:tnoremap <C-n> <C-\><C-n>
|
||||
|
||||
" Sexp in Conjure (since it's fennel)
|
||||
" let g:sexp_filetypes = [ "fennel" ]
|
||||
|
||||
let g:rainbow_active = 0
|
||||
autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll
|
||||
|
||||
" general commands
|
||||
map <leader>t :NERDTreeToggle<CR>
|
||||
|
@ -351,3 +512,4 @@
|
|||
vimAlias = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue