Skip to content

Commit e0a824a

Browse files
author
Jack Pordi
committed
Switched to neovim and vim-plug, no longer using tmux status bar
1 parent 5313524 commit e0a824a

File tree

4 files changed

+248
-25
lines changed

4 files changed

+248
-25
lines changed

.nvimrc

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
if !has('nvim')
2+
set ttymouse=xterm2
3+
endif
4+
5+
" This is the main vim configuration file.
6+
" It is executed as a series of commands when vim starts up
7+
8+
" Enables Syntax highlighting
9+
syntax on
10+
11+
" Filetype plugin on
12+
filetype plugin indent on
13+
14+
"Enables Mouse Usage
15+
set mouse=a
16+
17+
" Enables line numbers (relative)
18+
set relativenumber
19+
20+
" Expands tabs to spaces with the tab key
21+
set expandtab
22+
set smarttab
23+
set shiftwidth=2
24+
set tabstop=2
25+
set autoindent
26+
"set smartindent
27+
28+
29+
" Remember Cursor position
30+
au BufReadPost *
31+
\ if line("'\"") > 0 && line("'\"") <= line("$") && &filetype != "gitcommit" |
32+
\ execute("normal `\"") |
33+
\ endif
34+
35+
" Sets vim to use OS clipboard
36+
set clipboard^=unnamed
37+
38+
" Prevents formatting bullshit when pasting
39+
set nopaste
40+
41+
" Enables alt-mappings to function properly
42+
for i in range(97,122)
43+
let c = nr2char(i)
44+
exec "map \e".c." <M-".c.">"
45+
exec "map! \e".c." <M-".c.">"
46+
endfor
47+
48+
49+
" Enables lines and blocks swapping with alt-j, altk
50+
nnoremap <M-j> :m .+1<CR>==
51+
nnoremap <M-k> :m .-2<CR>==
52+
nnoremap <M-J> :m .+10<CR>==
53+
nnoremap <M-K> :m .-11<CR>==
54+
inoremap <M-j> <Esc>:m .+1<CR>==gi
55+
inoremap <M-k> <Esc>:m .-2<CR>==gi
56+
vnoremap <M-j> :m '>+1<CR>gv=gv
57+
vnoremap <M-k> :m '<-2<CR>gv=gv
58+
" Reduces delay for escape as alt has the same sequence as escape
59+
set timeoutlen=10 ttimeoutlen=0
60+
61+
" Faster line movement with uppercase J and K
62+
map <S-j> 10j
63+
map <S-k> 10k
64+
65+
" Through Paragraphs with { down and } up as opposed to default (reversed)
66+
nnoremap { }
67+
nnoremap } {
68+
69+
" Editing a protected file as 'sudo'
70+
cmap w!! %!sudo tee > /dev/null %
71+
72+
set t_Co=256
73+
highlight ColorColumn ctermbg=0
74+
set colorcolumn=80
75+
" It is possible to configure settings with this file.
76+
" This line sets it so that
77+
" automatically
78+
" when the buffer is read into (when a file is loaded)
79+
" when the filename matches any asm file
80+
" execute the command after the colon - this sets filetype to be nasm for highlighting
81+
au BufRead *.asm :set ft=nasm
82+
83+
"colorscheme solarized8_dark
84+
"set background=dark
85+
"highlight Normal ctermbg=Black
86+
87+
"---------- Hardcore nav mode, not reccomended for newbs
88+
89+
" Disable Arrow keys in Escape mode
90+
" map <up> <nop>
91+
" map <down> <nop>
92+
" map <left> <nop>
93+
" map <right> <nop>
94+
95+
" Disable Arrow keys in Insert mode
96+
" imap <up> <nop>
97+
" imap <down> <nop>
98+
" imap <left> <nop>
99+
" imap <right> <nop>
100+
101+
"----------PLUGINS----------------------------------
102+
103+
" Specify a directory for plugins
104+
" - For Neovim: ~/.local/share/nvim/plugged
105+
" - Avoid using standard Vim directory names like 'plugin'
106+
call plug#begin('~/.vim/plugged')
107+
108+
Plug 'kien/ctrlp.vim'
109+
Plug 'scrooloose/syntastic'
110+
Plug 'ervandew/supertab'
111+
Plug 'bling/vim-airline'
112+
Plug 'vim-airline/vim-airline-themes'
113+
Plug 'yggdroot/indentline'
114+
Plug 'christoomey/vim-tmux-navigator'
115+
Plug 'jiangmiao/auto-pairs'
116+
117+
call plug#end()
118+
119+
"-------------------CtrlP-----------------------
120+
121+
let g:ctrlp_custom_ignore = {
122+
\ 'dir': '\v[\/]\.(git|hg|svn)$',
123+
\ 'file': '\v\.(exe|so|dll)$',
124+
\ }
125+
126+
let g:ctrlp_show_hidden = 1
127+
128+
129+
"--------------------Airline Status Bar-------------
130+
set laststatus=2
131+
set noshowmode
132+
133+
let g:airline_theme='monochrome'
134+
135+
let g:airline#extensions#tabline#enabled = 1
136+
let g:airline#extensions#tabline#left_sep = ' '
137+
let g:airline#extensions#tabline#left_alt_sep = '|'
138+
139+
" Show just the filename
140+
let g:airline#extensions#tabline#fnamemod = ':t'
141+
142+
" This allows buffers to be hidden if you've modified a buffer.
143+
" This is almost a must if you wish to use buffers in this way.
144+
set hidden
145+
146+
" To open a new empty buffer
147+
" This replaces :tabnew which I used to bind to this mapping
148+
nmap <leader>T :enew<CR>
149+
150+
" Move to the next buffer
151+
nnoremap <silent> ] :bnext<CR>
152+
153+
" Move to the previous buffer
154+
nnoremap <silent> [ :bprevious<CR>
155+
156+
"-------------Syntastic------------------------------
157+
158+
set statusline+=%#warningmsg#
159+
set statusline+=%{SyntasticStatuslineFlag()}
160+
set statusline+=%*
161+
162+
let g:syntastic_always_populate_loc_list = 1
163+
let g:syntastic_auto_loc_list = 1
164+
let g:syntastic_check_on_open = 1
165+
let g:syntastic_check_on_wq = 0
166+
167+
168+
" C config
169+
let g:syntastic_c_include_dirs = [ '../include', 'include', '../../include', '../../../include', 'header', '../headers', '../../headers', '../../../headers', '../utils/include', '../../utils/include']
170+
171+
" Java classpaths
172+
let g:syntastic_java_checkers=['java']
173+
let g:syntastic_java_javac_config_file_enabled = 1
174+
175+
176+
"----------------Indent Guides-------------
177+
178+
let g:indent_guides_enable_on_vim_startup = 1
179+
180+
"-----------------Tmux Integration-----------
181+
let g:tmux_navigator_no_mappings = 1
182+
"
183+
"nnoremap <silent> <M-Left> :TmuxNavigateLeft<cr>
184+
"nnoremap <silent> <M-Down> :TmuxNavigateDown<cr>
185+
"nnoremap <silent> <M-Up> :TmuxNavigateUp<cr>
186+
"nnoremap <silent> <M-Right> :TmuxNavigateRight<cr>
187+
""nnoremap <silent> {Previous-Mapping} :TmuxNavigatePrevious<cr>

.tmux.conf

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# always load the reset file first
2+
#source-file ~/.tmux.reset.conf
13

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

62+
# Smart pane switching with awareness of Vim splits.
63+
# See: https://github.com/christoomey/vim-tmux-navigator
64+
#is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
65+
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
66+
#bind-key -n M-Left if-shell "$is_vim" "send-keys C-h" "select-pane -L"
67+
#bind-key -n M-Down if-shell "$is_vim" "send-keys C-j" "select-pane -D"
68+
#bind-key -n M-Up if-shell "$is_vim" "send-keys C-k" "select-pane -U"
69+
#bind-key -n M-Right if-shell "$is_vim" "send-keys C-l" "select-pane -R"
70+
##bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
71+
#bind-key -T copy-mode-vi M-Left select-pane -L
72+
#bind-key -T copy-mode-vi M-Down select-pane -D
73+
#bind-key -T copy-mode-vi M-Up select-pane -U
74+
#bind-key -T copy-mode-vi M-Right select-pane -R
75+
##bind-key -T copy-mode-vi C-\\ select-pane -l
76+
6077
# Shift arrow to switch windows
6178
bind -n S-Left previous-window
6279
bind -n S-Right next-window
@@ -84,17 +101,17 @@ run-shell ~/clone/path/yank.tmux
84101
bind r source-file ~/.tmux.conf
85102

86103
# THEME
87-
set -g status-bg black
88-
set -g status-fg white
89-
set -g window-status-current-bg white
90-
set -g window-status-current-fg black
91-
set -g window-status-current-attr bold
92-
set -g status-interval 60
93-
set -g status-left-length 30
94-
set -g status-left '#[fg=green](#S) #(whoami)'
95-
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
104+
#set -g status-bg black
105+
#set -g status-fg white
106+
#set -g window-status-current-bg white
107+
#set -g window-status-current-fg black
108+
#set -g window-status-current-attr bold
109+
#set -g status-interval 60
110+
#set -g status-left-length 30
111+
#set -g status-left '#[fg=green](#S) #(whoami)'
112+
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
96113

97114
# Powerline
98-
99-
run-shell "powerline-daemon -q"
100-
source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"
115+
set -g status off
116+
#run-shell "powerline-daemon -q"
117+
#source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"

.vimrc

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,38 @@ filetype plugin indent on
1717
set mouse=a
1818

1919
" Enables line numbers (relative)
20-
" set relativenumber
21-
set number
20+
set relativenumber
2221

2322
" Expands tabs to spaces with the tab key
2423
set expandtab
2524
set smarttab
2625
set shiftwidth=2
2726
set tabstop=2
27+
set autoindent
28+
"set smartindent
2829

2930
" Sets vim to use OS clipboard
3031
set clipboard^=unnamed
3132

33+
" Enables alt-mappings to function properly
34+
for i in range(97,122)
35+
let c = nr2char(i)
36+
exec "map \e".c." <M-".c.">"
37+
exec "map! \e".c." <M-".c.">"
38+
endfor
39+
40+
3241
" Enables lines and blocks swapping with alt-j, altk
33-
nnoremap <A-j> :m .+1<CR>==
34-
nnoremap <A-k> :m .-2<CR>==
35-
inoremap <A-j> <Esc>:m .+1<CR>==gi
36-
inoremap <A-k> <Esc>:m .-2<CR>==gi
37-
vnoremap <A-j> :m '>+1<CR>gv=gv
38-
vnoremap <A-k> :m '<-2<CR>gv=gv
42+
nnoremap <M-j> :m .+1<CR>==
43+
nnoremap <M-k> :m .-2<CR>==
44+
nnoremap <M-J> :m .+10<CR>==
45+
nnoremap <M-K> :m .-11<CR>==
46+
inoremap <M-j> <Esc>:m .+1<CR>==gi
47+
inoremap <M-k> <Esc>:m .-2<CR>==gi
48+
vnoremap <M-j> :m '>+1<CR>gv=gv
49+
vnoremap <M-k> :m '<-2<CR>gv=gv
50+
" Reduces delay for escape as alt has the same sequence as escape
51+
set timeoutlen=10 ttimeoutlen=0
3952

4053
" Faster line movement with uppercase J and K
4154
map <S-j> 10j
@@ -45,6 +58,9 @@ map <S-k> 10k
4558
nnoremap { }
4659
nnoremap } {
4760
61+
" Editing a protected file as 'sudo'
62+
cmap w!! %!sudo tee > /dev/null %
63+
4864

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

59-
colorscheme solarized
60-
set background=dark
74+
"colorscheme solarized8_dark
75+
"set background=dark
6176
"highlight Normal ctermbg=Black
6277
set t_Co=256
6378

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

66-
" Disable Arrow keys in Escape mode
81+
" Disable Arrow keys in Escape mode
6782
" map <up> <nop>
6883
" map <down> <nop>
6984
" map <left> <nop>
7085
" map <right> <nop>
7186

72-
" Disable Arrow keys in Insert mode
87+
" Disable Arrow keys in Insert mode
7388
" imap <up> <nop>
7489
" imap <down> <nop>
7590
" imap <left> <nop>
@@ -82,6 +97,8 @@ set laststatus=2
8297
" Powerline fonts
8398
let g:airline_powerline_fonts = 1
8499

100+
let g:airline_theme='luna'
101+
85102
" Enable the list of buffers
86103

87104
" Add Airline tabs/list buffers

config.fish

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

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

4+
export TERM=xterm-256color
5+
46
neofetch
57

68
set -g theme_color_scheme solarized-light

0 commit comments

Comments
 (0)