Skip to content

Commit

Permalink
Switched to neovim and vim-plug, no longer using tmux status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Pordi committed Jul 13, 2017
1 parent 5313524 commit e0a824a
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 25 deletions.
187 changes: 187 additions & 0 deletions .nvimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
if !has('nvim')
set ttymouse=xterm2
endif

" This is the main vim configuration file.
" It is executed as a series of commands when vim starts up

" Enables Syntax highlighting
syntax on

" Filetype plugin on
filetype plugin indent on

"Enables Mouse Usage
set mouse=a

" Enables line numbers (relative)
set relativenumber

" Expands tabs to spaces with the tab key
set expandtab
set smarttab
set shiftwidth=2
set tabstop=2
set autoindent
"set smartindent


" Remember Cursor position
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") && &filetype != "gitcommit" |
\ execute("normal `\"") |
\ endif

" Sets vim to use OS clipboard
set clipboard^=unnamed

" Prevents formatting bullshit when pasting
set nopaste

" Enables alt-mappings to function properly
for i in range(97,122)
let c = nr2char(i)
exec "map \e".c." <M-".c.">"
exec "map! \e".c." <M-".c.">"
endfor


" Enables lines and blocks swapping with alt-j, altk
nnoremap <M-j> :m .+1<CR>==
nnoremap <M-k> :m .-2<CR>==
nnoremap <M-J> :m .+10<CR>==
nnoremap <M-K> :m .-11<CR>==
inoremap <M-j> <Esc>:m .+1<CR>==gi
inoremap <M-k> <Esc>:m .-2<CR>==gi
vnoremap <M-j> :m '>+1<CR>gv=gv
vnoremap <M-k> :m '<-2<CR>gv=gv
" Reduces delay for escape as alt has the same sequence as escape
set timeoutlen=10 ttimeoutlen=0

" Faster line movement with uppercase J and K
map <S-j> 10j
map <S-k> 10k
" Through Paragraphs with { down and } up as opposed to default (reversed)
nnoremap { }
nnoremap } {
" Editing a protected file as 'sudo'
cmap w!! %!sudo tee > /dev/null %
set t_Co=256
highlight ColorColumn ctermbg=0
set colorcolumn=80
" It is possible to configure settings with this file.
" This line sets it so that
" automatically
" when the buffer is read into (when a file is loaded)
" when the filename matches any asm file
" execute the command after the colon - this sets filetype to be nasm for highlighting
au BufRead *.asm :set ft=nasm

"colorscheme solarized8_dark
"set background=dark
"highlight Normal ctermbg=Black

"---------- Hardcore nav mode, not reccomended for newbs

" Disable Arrow keys in Escape mode
" map <up> <nop>
" map <down> <nop>
" map <left> <nop>
" map <right> <nop>

" Disable Arrow keys in Insert mode
" imap <up> <nop>
" imap <down> <nop>
" imap <left> <nop>
" imap <right> <nop>

"----------PLUGINS----------------------------------

" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

Plug 'kien/ctrlp.vim'
Plug 'scrooloose/syntastic'
Plug 'ervandew/supertab'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'yggdroot/indentline'
Plug 'christoomey/vim-tmux-navigator'
Plug 'jiangmiao/auto-pairs'

call plug#end()

"-------------------CtrlP-----------------------

let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ }

let g:ctrlp_show_hidden = 1


"--------------------Airline Status Bar-------------
set laststatus=2
set noshowmode

let g:airline_theme='monochrome'

let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'

" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'

" This allows buffers to be hidden if you've modified a buffer.
" This is almost a must if you wish to use buffers in this way.
set hidden

" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nmap <leader>T :enew<CR>
" Move to the next buffer
nnoremap <silent> ] :bnext<CR>
" Move to the previous buffer
nnoremap <silent> [ :bprevious<CR>
"-------------Syntastic------------------------------

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

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


" C config
let g:syntastic_c_include_dirs = [ '../include', 'include', '../../include', '../../../include', 'header', '../headers', '../../headers', '../../../headers', '../utils/include', '../../utils/include']

" Java classpaths
let g:syntastic_java_checkers=['java']
let g:syntastic_java_javac_config_file_enabled = 1


"----------------Indent Guides-------------

let g:indent_guides_enable_on_vim_startup = 1

"-----------------Tmux Integration-----------
let g:tmux_navigator_no_mappings = 1
"
"nnoremap <silent> <M-Left> :TmuxNavigateLeft<cr>
"nnoremap <silent> <M-Down> :TmuxNavigateDown<cr>
"nnoremap <silent> <M-Up> :TmuxNavigateUp<cr>
"nnoremap <silent> <M-Right> :TmuxNavigateRight<cr>
""nnoremap <silent> {Previous-Mapping} :TmuxNavigatePrevious<cr>
41 changes: 29 additions & 12 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# always load the reset file first
#source-file ~/.tmux.reset.conf

# remap prefix from 'C-b' to 'C-a'
unbind C-b
Expand Down Expand Up @@ -57,6 +59,21 @@ bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
#is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
#bind-key -n M-Left if-shell "$is_vim" "send-keys C-h" "select-pane -L"
#bind-key -n M-Down if-shell "$is_vim" "send-keys C-j" "select-pane -D"
#bind-key -n M-Up if-shell "$is_vim" "send-keys C-k" "select-pane -U"
#bind-key -n M-Right if-shell "$is_vim" "send-keys C-l" "select-pane -R"
##bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#bind-key -T copy-mode-vi M-Left select-pane -L
#bind-key -T copy-mode-vi M-Down select-pane -D
#bind-key -T copy-mode-vi M-Up select-pane -U
#bind-key -T copy-mode-vi M-Right select-pane -R
##bind-key -T copy-mode-vi C-\\ select-pane -l

# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
Expand Down Expand Up @@ -84,17 +101,17 @@ run-shell ~/clone/path/yank.tmux
bind r source-file ~/.tmux.conf

# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
#set -g status-bg black
#set -g status-fg white
#set -g window-status-current-bg white
#set -g window-status-current-fg black
#set -g window-status-current-attr bold
#set -g status-interval 60
#set -g status-left-length 30
#set -g status-left '#[fg=green](#S) #(whoami)'
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'

# Powerline

run-shell "powerline-daemon -q"
source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"
set -g status off
#run-shell "powerline-daemon -q"
#source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"
43 changes: 30 additions & 13 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,38 @@ filetype plugin indent on
set mouse=a

" Enables line numbers (relative)
" set relativenumber
set number
set relativenumber

" Expands tabs to spaces with the tab key
set expandtab
set smarttab
set shiftwidth=2
set tabstop=2
set autoindent
"set smartindent

" Sets vim to use OS clipboard
set clipboard^=unnamed

" Enables alt-mappings to function properly
for i in range(97,122)
let c = nr2char(i)
exec "map \e".c." <M-".c.">"
exec "map! \e".c." <M-".c.">"
endfor


" Enables lines and blocks swapping with alt-j, altk
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
nnoremap <M-j> :m .+1<CR>==
nnoremap <M-k> :m .-2<CR>==
nnoremap <M-J> :m .+10<CR>==
nnoremap <M-K> :m .-11<CR>==
inoremap <M-j> <Esc>:m .+1<CR>==gi
inoremap <M-k> <Esc>:m .-2<CR>==gi
vnoremap <M-j> :m '>+1<CR>gv=gv
vnoremap <M-k> :m '<-2<CR>gv=gv
" Reduces delay for escape as alt has the same sequence as escape
set timeoutlen=10 ttimeoutlen=0

" Faster line movement with uppercase J and K
map <S-j> 10j
Expand All @@ -45,6 +58,9 @@ map <S-k> 10k
nnoremap { }
nnoremap } {
" Editing a protected file as 'sudo'
cmap w!! %!sudo tee > /dev/null %

set colorcolumn=80
" It is possible to configure settings with this file.
Expand All @@ -54,22 +70,21 @@ set colorcolumn=80
" when the filename matches any asm file
" execute the command after the colon - this sets filetype to be nasm for highlighting
au BufRead *.asm :set ft=nasm
set autoindent

colorscheme solarized
set background=dark
"colorscheme solarized8_dark
"set background=dark
"highlight Normal ctermbg=Black
set t_Co=256

"---------- Hardcore nav mode, not reccomended for newbs

" Disable Arrow keys in Escape mode
" Disable Arrow keys in Escape mode
" map <up> <nop>
" map <down> <nop>
" map <left> <nop>
" map <right> <nop>

" Disable Arrow keys in Insert mode
" Disable Arrow keys in Insert mode
" imap <up> <nop>
" imap <down> <nop>
" imap <left> <nop>
Expand All @@ -82,6 +97,8 @@ set laststatus=2
" Powerline fonts
let g:airline_powerline_fonts = 1

let g:airline_theme='luna'

" Enable the list of buffers

" Add Airline tabs/list buffers
Expand Down
2 changes: 2 additions & 0 deletions config.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

test $TERM != "screen"; and exec tmux

export TERM=xterm-256color

neofetch

set -g theme_color_scheme solarized-light
Expand Down

0 comments on commit e0a824a

Please sign in to comment.