summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/vim/conf/rc.vim104
-rw-r--r--pkgs/vim/conf/vim-color-akr/colors/akr.vim103
-rw-r--r--pkgs/vim/custom.nix26
-rw-r--r--pkgs/vim/nvim.nix12
-rw-r--r--pkgs/vim/plugins.nix18
-rw-r--r--pkgs/vim/vim.nix14
6 files changed, 277 insertions, 0 deletions
diff --git a/pkgs/vim/conf/rc.vim b/pkgs/vim/conf/rc.vim
new file mode 100644
index 0000000..bc41351
--- /dev/null
+++ b/pkgs/vim/conf/rc.vim
@@ -0,0 +1,104 @@
+syntax enable
+filetype plugin indent on
+
+colorscheme akr
+
+set encoding=utf-8
+set showcmd
+set nocompatible
+set nocursorline
+set number
+set lazyredraw
+set ttyfast
+set mouse=a
+set t_Co=256
+set shell=/bin/sh
+set sessionoptions-=options
+
+set directory=~/.vim/swap//,.
+
+set wrap
+set tabstop=4 shiftwidth=4
+set backspace=indent,eol,start
+set listchars=tab:\ \
+set list
+set linebreak
+
+set hlsearch
+set incsearch
+set ignorecase
+set smartcase
+
+let mapleader=","
+
+map <leader>s :let @/=""<CR>
+map <leader>c zz
+map <leader>d <c-]>
+
+nmap <backspace> :e#<CR>
+nmap f za
+nmap F zA
+
+autocmd InsertEnter * :setlocal nohlsearch
+autocmd InsertLeave * :setlocal hlsearch
+
+autocmd FileType scheme setlocal shiftwidth=2 tabstop=2 expandtab
+autocmd FileType lisp setlocal shiftwidth=2 tabstop=2 expandtab
+autocmd FileType racket setlocal shiftwidth=2 tabstop=2 expandtab
+autocmd FileType pandoc setlocal nonumber autoread
+autocmd FileType tex set conceallevel=2
+
+vnoremap cc "+y
+nnoremap cc "+p
+
+nnoremap <C-left> gT
+nnoremap <C-right> gt
+nnoremap <space> @q
+nnoremap J }
+nnoremap K {
+
+nmap <Left> <<
+nmap <Right> >>
+vmap <Left> <gv
+vmap <Right> >gv
+
+nmap <Up> [e
+nmap <Down> ]e
+vmap <Up> [egv
+vmap <Down> ]egv
+
+nnoremap <A-left> <C-W>h
+nnoremap <A-right> <C-W>l
+nnoremap <A-up> <C-W>k
+nnoremap <A-down> <C-W>j
+
+let g:gitgutter_enabled = 0
+let g:gitgutter_highlight_lines = 1
+let g:goyo_width = 90
+let g:goyo_margin_top = 1
+let g:goyo_margin_bottom = 0
+
+nnoremap <F5> :UndotreeToggle<CR>
+nnoremap <F6> :GitGutterToggle<CR>
+nnoremap <F7> :set cursorline!<CR>
+nnoremap <F8> :TagbarToggle<CR>
+nnoremap <F12> :Goyo<CR>
+
+nnoremap <c-b> :CtrlPBuffer<CR>
+nnoremap <c-t> :CtrlPTag<CR>
+nnoremap <a-t> :CtrlPBufTag<CR>
+
+let g:ctrlp_custom_ignore = {
+\ 'dir': '\.git$',
+\ 'file': '\.o$\|\.d$'
+\ }
+
+let g:undotree_SetFocusWhenToggle = 1
+
+let g:tagbar_autoclose = 1
+let g:tagbar_autopreview = 1
+let g:tagbar_compact = 1
+let g:tagbar_width = 70
+
+let g:localvimrc_sandbox = 0
+let g:localvimrc_persistent = 2
diff --git a/pkgs/vim/conf/vim-color-akr/colors/akr.vim b/pkgs/vim/conf/vim-color-akr/colors/akr.vim
new file mode 100644
index 0000000..127f022
--- /dev/null
+++ b/pkgs/vim/conf/vim-color-akr/colors/akr.vim
@@ -0,0 +1,103 @@
+hi clear
+syntax reset
+let background = "dark"
+let g:colors_name = "akr"
+
+hi Normal gui=NONE guifg=#F2F2F2 guibg=#161616
+hi NonText gui=NONE guifg=#161616 guibg=#161616
+hi LineNr gui=NONE guifg=#605c5a guibg=NONE
+hi Cursor gui=NONE guifg=#F2F2F2 guibg=#D80F33
+hi CursorColumn gui=NONE guifg=NONE guibg=#000000
+hi CursorLine gui=NONE guifg=NONE guibg=#212121
+hi CursorLineNr gui=NONE guifg=#aadb0f guibg=#212121
+hi ColorColumn gui=NONE guifg=NONE guibg=#aadb0f
+hi SignColumn gui=NONE guifg=NONE guibg=#aadb0f
+
+hi TabLine gui=NONE guifg=#909636 guibg=#161616
+hi TabLineFill gui=NONE guifg=NONE guibg=#262626
+hi TabLineSel gui=NONE guifg=#161616 guibg=#909636
+hi StatusLine gui=NONE guifg=#909636 guibg=#212121
+hi StatusLineNC gui=NONE guifg=#909637 guibg=#212121
+hi VertSplit gui=NONE guifg=#262626 guibg=#262626
+hi Visual gui=NONE guifg=#E4E093 guibg=#8C3346
+hi VisualNOS gui=NONE guifg=NONE guibg=NONE
+
+hi Pmenu gui=NONE guifg=NONE guibg=#000000
+hi PmenuSbar gui=NONE guifg=NONE guibg=#262626
+hi PmenuSel gui=NONE guifg=NONE guibg=#333333
+hi PmenuThumb gui=NONE guifg=NONE guibg=#424242
+hi DiffAdd gui=NONE guifg=NONE guibg=#082608
+hi DiffChange gui=NONE guifg=NONE guibg=#000000
+hi DiffDelete gui=NONE guifg=NONE guibg=#260808
+hi DiffText gui=NONE guifg=NONE guibg=#333333
+hi Search gui=NONE guifg=#161616 guibg=#909636
+hi IncSearch gui=NONE guifg=#161616 guibg=#aadb0f
+
+hi Comment gui=italic guifg=#F2F2F2 guibg=NONE
+hi Type gui=NONE guifg=#aadb0f guibg=NONE
+hi Boolean gui=NONE guifg=#aadb0f guibg=NONE
+hi String gui=NONE guifg=#aadb0f guibg=NONE
+hi Number gui=NONE guifg=#aadb0f guibg=NONE
+hi Title gui=bold guifg=#aadb0f guibg=NONE
+hi Todo gui=standout guifg=NONE guibg=NONE
+hi Constant gui=italic guifg=#F2F2F2 guibg=NONE
+hi Identifier gui=bold guifg=#F2F2F2 guibg=#161616
+hi Statement gui=bold guifg=#aadb0f guibg=NONE
+hi StorageClass gui=bold guifg=#aadb0f guibg=NONE
+hi Conditional gui=bold guifg=#aadb0f guibg=NONE
+hi MatchParen gui=bold guifg=NONE guibg=NONE
+
+hi Special gui=NONE guifg=#808080 guibg=NONE
+hi SpecialKeyTab gui=NONE guifg=NONE guibg=#212121
+
+hi ColorColumn gui=NONE guifg=NONE guibg=#000000
+hi Conceal gui=NONE guifg=#808080 guibg=NONE
+hi Directory gui=NONE guifg=#F2F2F2 guibg=NONE
+hi Error gui=NONE guifg=NONE guibg=#8C3346
+hi ErrorMsg gui=NONE guifg=NONE guibg=#8C3346
+hi FoldColumn gui=NONE guifg=#616161 guibg=NONE
+hi Folded gui=NONE guifg=#707070 guibg=NONE
+hi Ignore gui=NONE guifg=NONE guibg=NONE
+hi ModeMsg gui=NONE guifg=NONE guibg=NONE
+hi MoreMsg gui=NONE guifg=NONE guibg=NONE
+hi Question gui=NONE guifg=NONE guibg=NONE
+hi SignColumn gui=NONE guifg=#616161 guibg=NONE
+hi Underlined gui=NONE guifg=NONE guibg=NONE
+hi WarningMsg gui=NONE guifg=NONE guibg=#260808
+hi WildMenu gui=NONE guifg=NONE guibg=#525252
+hi lCursor gui=NONE guifg=NONE guibg=NONE
+hi PreProc gui=NONE guifg=NONE guibg=NONE
+
+hi SpellBad gui=undercurl guifg=NONE guibg=#260808
+hi SpellCap gui=undercurl guifg=NONE guibg=NONE
+hi SpellLocal gui=undercurl guifg=NONE guibg=#082608
+hi SpellRare gui=undercurl guifg=NONE guibg=#262626
+
+hi xmlTagName gui=NONE guifg=#F2F2F2 guibg=NONE
+hi xmlEndTag gui=NONE guifg=#F2F2F2 guibg=NONE
+hi xmlNamespace gui=bold guifg=#F2F2F2 guibg=NONE
+hi xmlAttrib gui=NONE guifg=#F2F2F2 guibg=NONE
+
+hi vimwikiLink gui=underline guifg=#aadb0f guibg=NONE
+
+hi texSection gui=bold guifg=#aadb0f guibg=NONE
+hi texMathZoneX gui=NONE guifg=NONE guibg=#000000
+hi texMathText gui=NONE guifg=NONE guibg=#000000
+hi texMathSymbol gui=bold guifg=NONE guibg=#000000
+hi texMathOper gui=bold guifg=#aadb0f guibg=#000000
+hi texMathMatcher gui=NONE guifg=NONE guibg=#000000
+hi texTypeStyle gui=bold guifg=NONE guibg=#000000
+hi texStatement gui=bold guifg=NONE guibg=NONE
+hi texGreek gui=NONE guifg=NONE guibg=#000000
+hi texBeginEnd gui=NONE guifg=#aadb0f guibg=NONE
+hi texSubscript gui=NONE guifg=NONE guibg=#000000
+hi texSuperscript gui=NONE guifg=NONE guibg=#000000
+hi texBeginEndName gui=NONE guifg=NONE guibg=NONE
+hi Conceal gui=NONE guifg=NONE guibg=#000000
+
+hi prologClauseHead gui=NONE guifg=#aadb0f guibg=NONE
+
+hi IndentGuidesEven gui=NONE guifg=#424242 guibg=#2D2D2D
+hi IndentGuidesOdd gui=NONE guifg=#424242 guibg=#2D2D2D
+
+match SpecialKey '^\s\+'
diff --git a/pkgs/vim/custom.nix b/pkgs/vim/custom.nix
new file mode 100644
index 0000000..32700f6
--- /dev/null
+++ b/pkgs/vim/custom.nix
@@ -0,0 +1,26 @@
+{ pkgs }:
+
+let
+ vimrc = builtins.readFile ./conf/rc.vim;
+ plugins = pkgs.callPackage ./plugins.nix {};
+in
+{
+ vam = {
+ knownPlugins = pkgs.vimPlugins // plugins;
+ pluginDictionaries = [
+ { names = [
+ "ctrlp"
+ "undotree"
+ "vim-gitgutter"
+ "goyo"
+ "vim-localvimrc"
+ "tagbar"
+ "vim-addon-nix"
+ "vim-autoformat"
+ "vim-csexact"
+ "vim-color-akr"
+ ];}
+ ];
+ };
+ customRC = vimrc;
+}
diff --git a/pkgs/vim/nvim.nix b/pkgs/vim/nvim.nix
new file mode 100644
index 0000000..f9647ce
--- /dev/null
+++ b/pkgs/vim/nvim.nix
@@ -0,0 +1,12 @@
+{ pkgs, ... }:
+
+let
+ nvim = pkgs.neovim.override {
+ vimAlias = false;
+ configure = (import ./custom.nix { pkgs = pkgs; });
+ };
+in [
+ nvim
+ pkgs.ctags
+ pkgs.git
+]
diff --git a/pkgs/vim/plugins.nix b/pkgs/vim/plugins.nix
new file mode 100644
index 0000000..755ccf3
--- /dev/null
+++ b/pkgs/vim/plugins.nix
@@ -0,0 +1,18 @@
+{ pkgs, fetchgit }:
+
+let
+ buildVimPlugin = pkgs.vimUtils.buildVimPluginFrom2Nix;
+in {
+ "vim-csexact" = buildVimPlugin {
+ name = "vim-csexact";
+ src = fetchgit {
+ url = "https://github.com/KevinGoodsell/vim-csexact";
+ rev = "d694a55e8daee475bdf4748a1ef7c1562b581476";
+ sha256 = "1kwpxk68prdpzw4b7mpfwh2vq99gfymr544wzwcm072h2x89s1dv";
+ };
+ };
+ "vim-color-akr" = buildVimPlugin {
+ name = "vim-csexact";
+ src = ./conf/vim-color-akr;
+ };
+}
diff --git a/pkgs/vim/vim.nix b/pkgs/vim/vim.nix
new file mode 100644
index 0000000..0af940e
--- /dev/null
+++ b/pkgs/vim/vim.nix
@@ -0,0 +1,14 @@
+{ pkgs, ... }:
+
+let
+ custom_vim = pkgs.vim_configurable.customize {
+ name = "vim";
+ vimrcConfig = (import ./custom.nix { pkgs = pkgs; });
+ };
+in pkgs.lib.overrideDerivation custom_vim ( o: {
+ gui = true;
+ ftNixSupport = true;
+ cscopeSupport = true;
+ fontsetSupport = true;
+ multibyteSupport = true;
+} )