Initial commit to Github

This commit is contained in:
Mark Vainomaa 2016-04-11 19:33:20 +03:00
commit f14bf4b6cd
5 changed files with 328 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.pkg.tar.xz*
pkg/
src/
plug.vim

42
PKGBUILD Normal file
View File

@ -0,0 +1,42 @@
pkgname=neostrophic
pkgver=0.1
pkgrel=9
epoch=1
pkgdesc="mikroskeem's personal neovim config (read: go away)"
url="https://mikroskeem.eu/pages/neostrophic"
arch=(any)
license=(MIT)
install=neostrophic.install
depends=('neovim' # Editor itself
'python-neovim' # Deoplete needs this
'git' # Plugin manager dependency
'curl' # Gist plugin needs this
'fortune-mod' # Start screen text
'cowsay' # Start screen text formatting
)
optdepends=(
'xsel: You sure want this. Copy and paste directly to clipboard'
'neovim-qt-git: Run Neovim in a QT GUI instead of terminal'
'eslint: One of the dependencies for Syntastic JavaScript checker'
'flake8: One of the dependencies for Syntastic Python checker'
'python-pylint: One of the dependencies for Syntastic Python checker'
'python2-pylint: One of the dependencies for Syntastic Python checker'
)
source=('https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
'neostrophic.vim'
)
md5sums=('SKIP'
'SKIP'
)
package () {
cd "${srcdir}"
_dir="${pkgdir}/etc/xdg/nvim"
mkdir -p ${_dir} ${_dir}/autoload
install -Dm644 plug.vim ${_dir}/autoload
install -Dm644 neostrophic.vim ${_dir}/init.vim
}

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# Neostrophic
Personal [Neovim](https://neovim.io) config
Uses [vim-plug](https://github.com/junegunn/vim-plug) and loads of other useful plugins for me.
This configuration isn't exactly meant for others, use at your own risk 3:)
## Arch Linux users
Run `makepkg -i` and enjoy

12
neostrophic.install Normal file
View File

@ -0,0 +1,12 @@
post_install () {
post_upgrade "$@"
}
post_upgrade () {
echo "> Note: Move/delete your ~/.config/nvim/init.vim if you have one"
echo "> Also don't forget to run ':PlugInstall' ;)"
}
post_remove () {
echo "Don't forget to clean up \$XDG_CONFIG_DIR/nvim ;)"
}

259
neostrophic.vim Normal file
View File

@ -0,0 +1,259 @@
" mikroskeem's neovim config
" Bail if config is already loaded
if exists("g:loaded_neostrophic")
finish
endif
let g:loaded_neostrophic = 1
" neovim-qt Guifont command
command -nargs=? Guifont call rpcnotify(0, 'Gui', 'SetFont', "<args>") | let g:Guifont="<args>"
" Set options
set wildmode=longest,list,full
set completeopt-=preview
set shortmess+=cI
set noshowmode
set shortmess+=I
set nostartofline
set wrap
set textwidth=0
set wrapmargin=0
set background=dark
set number
set numberwidth=3
if $DISPLAY != ''
set clipboard+=unnamedplus
endif
set showmatch
set smartcase
set ignorecase
set undofile
set undoreload=100
set viminfo+=n$HOME/.config/nvim/tmp/viminfo
set showtabline=0
set backup
set backupdir=$HOME/.config/nvim/tmp/backup/
set undodir=$HOME/.config/nvim/tmp/undo/
set directory=$HOME/.config/nvim/tmp/swap/
set title
set cursorline
let mapleader = ','
function! s:center_header(lines) abort
let longest_line = max(map(copy(a:lines), 'len(v:val)'))
let centered_lines = map(copy(a:lines),
\ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
return centered_lines
endfunction
function! s:mkdir_p(p)
if !isdirectory(expand(a:p))
call mkdir(expand(a:p), "p")
endif
endfunction
function! s:set_indent()
if &ft =~ 'yaml\|coffee\|vim\|jade'
set softtabstop=2 shiftwidth=2
endif
if &ft =~ 'make'
set shiftwidth=2 tabstop=2 noexpandtab
endif
endfunction
" Make missing dirs
silent! call s:mkdir_p(&undodir)
silent! call s:mkdir_p(&backupdir)
silent! call s:mkdir_p(&directory)
" Default indent settings
set softtabstop=4
set shiftwidth=4
set expandtab
set shiftround
set autoindent
set copyindent
" Function call below overrides previous options
" if opened filetype was defined in function
autocmd! FileType * call s:set_indent()
" Fake $MYVIMRC
function! s:fake_vimrc()
let $MYVIMRC=$HOME . "/.config/nvim/init.vim"
endfunction
" UpdateRemotePlugins wrapper (used in vim-plug)
function! URP(info)
if a:info.status == 'installed'
silent! call s:fake_vimrc()
silent! UpdateRemotePlugins
endif
endfunction
" Eyecandy: loads color scheme after it's installation :3
function! Load_color_scheme(info)
if a:info.status == 'installed'
let s = printf("colorscheme %s", a:info.name)
silent! execute s
endif
endfunction
" Plugin configurations
let g:airline_theme = 'powerlineish'
let g:airline#extensions#branch#enabled = 1
let g:airline_powerline_fonts = 0
let g:airline#extensions#whitespace#enabled = 1
let g:airline#extensions#hunks#non_zero_only = 1
let g:airline#extensions#tabline#enabled = 1
let g:bufferline_echo = 0
let g:bufferline_modified = '*'
let g:bufferline_show_bufnr = 0
let g:molokai_original = 0
let g:rehash256 = 1
let g:syntastic_enable_balloons = 1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map = {
\ "mode": "active",
\ "active_filetypes": ["javascript", "python", "coffee", "jade", "yaml"],
\ "passive_filetypes": ["java", "c"]}
let g:syntastic_python_checkers = ['flake8', 'pylint']
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_yaml_checkers = ['yamllint', 'yamlxs']
let g:startify_session_dir = '~/.config/nvim/startify-session'
let g:startify_custom_header = s:center_header(map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['',''])
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_camel_case = 1
let g:python3_host_prog = '/usr/bin/python3'
let g:python3_host_skip_check = 1
let g:NERDTreeHijackNetrw = 1
let g:gitgutter_map_keys = 0
let g:gitgutter_highlight_lines = 0
let g:echodoc_enable_at_startup = 1
let g:rainbow_active = 1
let g:rainbow_conf = {
\ 'ctermfgs': ['red', 'lightgreen', 'lightred', 'lightblue', 'yellow']}
" Plugins
call plug#begin('~/.config/nvim/neostrophic_plugins')
Plug 'tpope/vim-sensible'
Plug 'Konfekt/FastFold'
Plug 'Matt-Deacalion/vim-systemd-syntax', {'for': 'systemd'}
Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'}
Plug 'Shougo/context_filetype.vim'
Plug 'Shougo/deoplete.nvim', {'do': function('URP')}
Plug 'Shougo/echodoc.vim'
Plug 'Shougo/unite.vim', {'on': 'Unite' }
Plug 'Shougo/vimproc.vim', {'do': 'make'}
Plug 'airblade/vim-gitgutter'
Plug 'bling/vim-bufferline'
Plug 'digitaltoad/vim-jade', {'for': ['jade', 'pug']}
Plug 'elzr/vim-json', {'for': 'json'}
Plug 'jelera/vim-javascript-syntax', {'for': 'javascript'}
Plug 'jmcantrell/vim-virtualenv'
Plug 'junegunn/goyo.vim', {'on': 'Goyo'}
Plug 'junegunn/limelight.vim', {'on': 'Limelight'}
Plug 'junegunn/vim-easy-align', {'on': 'EasyAlign'}
Plug 'justinmk/molokai', {'do': function('Load_color_scheme')}
Plug 'kchmck/vim-coffee-script', {'for': 'coffee'}
Plug 'luochen1990/rainbow'
Plug 'majutsushi/tagbar'
Plug 'mattn/gist-vim', {'on': 'Gist'}
Plug 'mattn/webapi-vim', {'on': 'Gist'}
Plug 'matze/vim-move'
Plug 'mhinz/vim-startify'
Plug 'mikroskeem/vim-sk-syntax', {'for': 'skript'}
Plug 'nelstrom/vim-markdown-folding', {'for': 'markdown'}
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'scrooloose/syntastic'
Plug 'terryma/vim-smooth-scroll'
Plug 'tpope/vim-markdown', {'for': 'markdown'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
Plug 'wavded/vim-stylus', {'for': 'stylus'}
Plug 'zchee/deoplete-jedi'
call plug#end()
" Goyo and Limelight
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
" Keybinds
" Tab controls
nnoremap <silent> <C-Left> :tabprevious<CR>
nnoremap <silent> <C-Right> :tabnext<CR>
nnoremap <silent> <C-Up> :tabnew<CR>
nnoremap <silent> <C-Down> :tabclose<CR>
" ----------------
nnoremap <silent> <F2> :tabnew<CR>
nnoremap <silent> <A-F2> :tabclose<CR>
nnoremap <silent> <F3> :tabprevious<CR>
nnoremap <silent> <F4> :tabnext<CR>
" Commonly used commands
" Undo
nnoremap <silent> <C-z> :u<CR>
" Quit
nnoremap <silent> <C-x> :q<CR>
" Just write
nnoremap <silent> <C-o> :w<CR>
" Quit without writing
nnoremap <silent> <C-A-x> :q!<CR>
" Remove search highlighting
nnoremap <silent> <C-A-a> :noh<CR>
" Commands from plugins
" File listing
nnoremap <silent> <C-n> :NERDTreeToggle<CR>
" Gist
nnoremap <silent> <C-A-g> :Gist -p<CR>
" Toggle Syntastic
nnoremap <silent> <C-A-f> :SyntasticToggleMode<CR>
" Goyo mode
nnoremap <silent> <F5> :Goyo<CR>
" neovim term
nnoremap <silent> <F6> :term<CR>
" neovim terminal mode -> normal mode with Alt-q
tnoremap <A-q> <C-\><C-n>
" Unite
nnoremap <silent> <F7> :Unite<CR>
" Show/hide tags
nnoremap <silent> <F8> :TagbarToggle<CR>
" vim-easy-align
" xnoremap / nnoremap won't work here somehow
xmap <leader>ga :EasyAlign<CR>
nmap <leader>ga :EasyAlign<CR>
" vim-smooth-scroll
noremap <silent> <C-u> :call smooth_scroll#up(&scroll, 0, 2)<CR>
noremap <silent> <C-d> :call smooth_scroll#down(&scroll, 0, 2)<CR>
noremap <silent> <C-b> :call smooth_scroll#up(&scroll*2, 0, 4)<CR>
noremap <silent> <C-f> :call smooth_scroll#down(&scroll*2, 0, 4)<CR>
" Re-apply fake $MYVIMRC
silent! call s:fake_vimrc()
" Load color scheme (reuse function)
call Load_color_scheme({'status': 'installed', 'name': 'molokai'})