@@ -113,12 +113,66 @@ set textwidth=110
113
113
114
114
115
115
" NERDTree setup
116
- map <leader> t :NERDTreeToggle <CR>
116
+ map <leader> T :NERDTreeToggle <CR>
117
+ map <leader> t :NERDTreeTabsToggle <CR>
117
118
" Was liking having drawer open up automatically, bit it's actually kind of annoying... Might modify later
118
119
" autocmd vimenter * if !argc() | NERDTree | endif
119
120
" autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
120
121
let NERDTreeIgnore = [' \.pyc$' , ' \.RData$' ]
121
122
123
+ " Stuff for working with tabs + windows
124
+ function ! MoveToPrevTab ()
125
+ " there is only one window
126
+ if tabpagenr (' $' ) == 1 && winnr (' $' ) == 1
127
+ return
128
+ endif
129
+ " preparing new window
130
+ let l: tab_nr = tabpagenr (' $' )
131
+ let l: cur_buf = bufnr (' %' )
132
+ if tabpagenr () != 1
133
+ close !
134
+ if l: tab_nr == tabpagenr (' $' )
135
+ tabprev
136
+ endif
137
+ sp
138
+ else
139
+ close !
140
+ exe " 0tabnew"
141
+ endif
142
+ " opening current buffer in new window
143
+ exe " b" .l: cur_buf
144
+ endfunc
145
+
146
+ function ! MoveToNextTab ()
147
+ " there is only one window
148
+ if tabpagenr (' $' ) == 1 && winnr (' $' ) == 1
149
+ return
150
+ endif
151
+ " preparing new window
152
+ let l: tab_nr = tabpagenr (' $' )
153
+ let l: cur_buf = bufnr (' %' )
154
+ if tabpagenr () < tab_nr
155
+ close !
156
+ if l: tab_nr == tabpagenr (' $' )
157
+ tabnext
158
+ endif
159
+ sp
160
+ else
161
+ close !
162
+ tabnew
163
+ endif
164
+ " opening current buffer in new window
165
+ exe " b" .l: cur_buf
166
+ endfunc
167
+
168
+ map <C-n> :call MoveToPrevTab()<CR>
169
+ map <C-m> :call MoveToNextTab()<CR>
170
+ map <C-B> :call MoveToPrevTab()<CR>
171
+ map <C-M> :call MoveToNextTab()<CR>
172
+ " Don't know why I have to call this...
173
+ unmap <enter>
174
+
175
+
122
176
" Disables pandoc folding - kinda neet though. Might be cool to activate this later
123
177
let g: pandoc_no_folding = 1
124
178
0 commit comments