Skip to content

Instantly share code, notes, and snippets.

@disassembler
Created May 22, 2017 20:04
Show Gist options
  • Save disassembler/dfe0af12d12858e513228b7a3dc3307c to your computer and use it in GitHub Desktop.
Save disassembler/dfe0af12d12858e513228b7a3dc3307c to your computer and use it in GitHub Desktop.
{ pkgs }:
let
# this is the vimrc.nix from above
vimrc = pkgs.callPackage ./vimrc.nix {};
# and the plugins.nix from above
plugins = pkgs.callPackage ./plugins.nix {};
in
{
customRC = vimrc;
vam = {
knownPlugins = pkgs.vimPlugins // plugins;
pluginDictionaries = [
{
names = [
"vim-airline-themes"
"ctrlp"
"fugitive"
"surround"
"vim-markdown"
"multiple-cursors"
"syntastic"
"gitgutter"
"vim-nix"
"youcompleteme"
"repeat"
"nerdtree"
"UltiSnips"
"vimwiki"
"vim-colorschemes"
"vim-colors_atelier-schemes"
"vim-lastplace"
"vim-go"
"yankring"
"youcompleteme"
"splice_vim"
"vim_jsx"
"vim_javascript"
];
}
];
};
}
syntax enable
colorscheme Atelier_SeasideDark
""" My settings:
" tab with two spaces
set nobackup
set noswapfile
set modeline
set modelines=2
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set smartcase
set autoindent
set nostartofline
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set colorcolumn=85
set visualbell
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
" Change current directory to files directory
nnoremap ,cd :cd %:p:h<CR>:pwd<CR>
" Split window settings
" Map ,ev to open vimrc in split
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
" Open new split with ,w
nnoremap <leader>n <C-w>v<C-w>l
" Movement around splits
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Map jj to esc key
inoremap jj <ESC>
let mapleader = "," " Change leader key to ,
set mouse-=a
set cmdheight=2
set wildmenu
set showcmd
set number
set ruler
set backspace=indent,eol,start " Allows backspace on these character
set clipboard=unnamedplus
" Map esc to exit terminal mode
:tnoremap <Esc> <C-\><C-n>
" php
autocmd Filetype php setlocal tabstop=4 shiftwidth=4 softtabstop=4
" ruby
autocmd FileType ruby compiler ruby
filetype plugin on " Enable filetype-specific plugins
" Those types
if has("user_commands")
command! -bang -nargs=? -complete=file E e<bang> <args>
command! -bang -nargs=? -complete=file W w<bang> <args>
command! -bang -nargs=? -complete=file Wq wq<bang> <args>
command! -bang -nargs=? -complete=file WQ wq<bang> <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
endif
" Relative numbering
function! NumberToggle()
if(&relativenumber == 1)
set nornu
set number
else
set rnu
endif
endfunc
" Toggle between normal and relative numbering.
nnoremap <leader>r :call NumberToggle()<cr>
" gitgutter settings
let g:gitgutter_max_signs = 2000
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
let
# some files
ycm = builtins.readFile ./plugins/ycm.vim;
in
''
" some variables
${ycm}
''
{ pkgs, fetchgit }:
let
buildVimPlugin = pkgs.vimUtils.buildVimPluginFrom2Nix;
in {
"vim-colors_atelier-schemes" = buildVimPlugin {
name = "vim-colors_atelier-schemes";
src = fetchgit {
url = "https://github.com/atelierbram/vim-colors_atelier-schemes";
rev = "633e723c4f2844dcf9437cb2275f1593fad9d608";
sha256 = "1icv8zk6bkdicmi9nq9dg564d0d35mz5j7p4ax8q790mgq9i692l";
};
dependencies = [];
};
"vim-lastplace" = buildVimPlugin {
name = "vim-lastplace";
src = fetchgit {
url = "https://github.com/farmergreg/vim-lastplace";
rev = "36c4ae38130232134ece7bdd0e844d8034b585ab";
sha256 = "09s0yvs8ylmj6zpp6k7nw4cric2flcdpy6k3i67nwm699lnd2f7i";
};
dependencies = [];
};
"splice_vim" = buildVimPlugin {
name = "splice.vim";
src = fetchgit {
url = "https://github.com/sjl/splice.vim";
rev = "c500afa9eed8c69527cd2b24401d12afb654d992";
sha256 = "1697qfahs7y8yhh7kkfmhmq7n564cssb2i7w43gkc1ai5bp3llfa";
};
dependencies = [];
};
"vim_jsx" = buildVimPlugin {
name = "vim-jsx";
src = fetchgit {
url = "https://github.com/mxw/vim-jsx";
rev = "eb656ed96435ccf985668ebd7bb6ceb34b736213";
sha256 = "1ydyifnfk5jfnyi4a1yc7g3b19aqi6ajddn12gjhi8v02z30vm65";
};
dependencies = [];
};
"vim_javascript" = buildVimPlugin {
name = "vim-javascript";
src = fetchgit {
url = "https://github.com/pangloss/vim-javascript";
rev = "2bca9c6f603a5bcdf6e7494158d178fb48c13f24";
sha256 = "067iwsxmvz47fv8k0p4dzwaisnwx2xshzkvi81c85ma193wsn8ml";
};
dependencies = [];
};
}
{ pkgs, lib, ... }:
let
nvim = pkgs.neovim.override {
vimAlias = true;
configure = (import ./vim/customization.nix { pkgs = pkgs; });
};
in
[ nvim pkgs.ctags pkgs.python ]
{ stdenv, writeText }:
let
generic = builtins.readFile ./vimrc/general.vim;
plug = import ./vimrc/pluginconfigurations.nix;
in
''
${generic}
" ... more here
${plug}
''
" TODO: add customizations here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment