Added files
This commit is contained in:
parent
121268b642
commit
bf566dc648
9 changed files with 2957 additions and 0 deletions
134
vim/.vimrc
Executable file
134
vim/.vimrc
Executable file
|
|
@ -0,0 +1,134 @@
|
|||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
Plug 'https://github.com/scrooloose/nerdtree.git'
|
||||
Plug 'https://github.com/vim-airline/vim-airline'
|
||||
Plug 'https://github.com/vim-airline/vim-airline-themes'
|
||||
Plug 'https://github.com/powerline/fonts'
|
||||
Plug 'https://github.com/tpope/vim-fugitive'
|
||||
|
||||
"Indent automiatically depending on filetype
|
||||
filetype plugin on
|
||||
set autoindent
|
||||
filetype indent on
|
||||
|
||||
"Set syntax on
|
||||
syntax enable
|
||||
|
||||
" Create the `tags` file (may need to install ctags first)
|
||||
command! MakeTags !ctags -R .
|
||||
|
||||
" Tab indentation
|
||||
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab
|
||||
|
||||
"End IDE specific options
|
||||
"<-------------------------------------------------------------------------->
|
||||
|
||||
" FINDING FILES
|
||||
|
||||
" Search down into subfolders
|
||||
" Provides tab-completion for all file-related tasks
|
||||
" " - Hit tab to :find by partial match
|
||||
" - Use * to make it fuzzy
|
||||
set path+=**
|
||||
|
||||
" Display all matching files when we tab complete
|
||||
set wildmenu
|
||||
|
||||
set backspace=2
|
||||
set background=dark
|
||||
|
||||
" Terminal colors
|
||||
"Colorscheme
|
||||
colorscheme solarized
|
||||
|
||||
"Automatically source vimrc on save.
|
||||
autocmd! bufwritepost $MYVIMRC source $MYVIMRC
|
||||
|
||||
"Line numbers
|
||||
set number
|
||||
|
||||
"Changes to current directory when creating new files
|
||||
set autochdir
|
||||
|
||||
"Higlhight search
|
||||
set hls
|
||||
|
||||
"Search as characters are entered
|
||||
set incsearch
|
||||
|
||||
"Line for linewrapping
|
||||
set colorcolumn=80
|
||||
set textwidth=80
|
||||
|
||||
"Remove temporary swap file
|
||||
set nobackup
|
||||
set noswapfile
|
||||
|
||||
"Wrap text instead of being on one line
|
||||
set lbr
|
||||
|
||||
"Paste mode toggle
|
||||
set pastetoggle=<F2>
|
||||
:map <F5> :e <CR>
|
||||
|
||||
"Default Colors for CursorLine
|
||||
set cursorline
|
||||
"hi CursorLine cterm=NONE ctermbg=235
|
||||
|
||||
"Activate statusbar
|
||||
set laststatus=2
|
||||
|
||||
"Space in toolbar is "%=\
|
||||
"set statusline=
|
||||
"set statusline+=%1*\ %n\ "Buffernr
|
||||
"set statusline+=%1*\ %F\ %m%r%w "File + modified/readonly
|
||||
"set statusline+=%1*\ %= "Space between filename
|
||||
"set statusline+=%1*\ %{hostname()}\ "Hostname
|
||||
"set statusline+=%1*\ %{strlen(&ft)?&ft:'none'}\ "Filetype
|
||||
"set statusline+=%1*\ %{''.(&fenc!=''?&fenc:&enc).''} "Encoding
|
||||
"set statusline+=%1*\ %{(&bomb?\",BOM\":\"\")}\ "Encoding2
|
||||
"set statusline+=%1*\ %{&ff}\ "FileFormat (dos/unix..)
|
||||
"set statusline+=%1*\ %l/%L\ \ "Rownumber/total (%)
|
||||
"set statusline+=%1*\ %P\ "Readonly? Top/bot
|
||||
|
||||
"Statusbar colors
|
||||
"hi User1 ctermbg=237
|
||||
|
||||
"Copy to clipboard
|
||||
vnoremap y "+y
|
||||
vnoremap x "+x
|
||||
vnoremap c "+c
|
||||
|
||||
"Built-in completion
|
||||
function! Smart_TabComplete()
|
||||
let line = getline('.') " current line
|
||||
let substr = strpart(line, -1, col('.')+1) " from the start of the current
|
||||
" of the cursor
|
||||
let substr = matchstr(substr, "[^ \t]*$") " word till cursor
|
||||
if (strlen(substr)==0) " nothing to match on empty string
|
||||
return "\<tab>"
|
||||
endif
|
||||
let has_period = match(substr, '\.') != -1 " position of period, if any
|
||||
let has_slash = match(substr, '\/') != -1 " position of slash, if any
|
||||
if (!has_period && !has_slash)
|
||||
return "\<C-X>\<C-P>" " existing text matching
|
||||
elseif ( has_slash )
|
||||
return "\<C-X>\<C-F>" " file matching
|
||||
else
|
||||
return "\<C-X>\<C-O>" " plugin matching
|
||||
endif
|
||||
endfunction
|
||||
inoremap <tab> <c-r>=Smart_TabComplete()<CR>
|
||||
|
||||
" Plugins
|
||||
"
|
||||
" Nerdtree
|
||||
map <C-e> :NERDTreeToggle<CR>
|
||||
|
||||
" Airline
|
||||
let g:airline_theme = 'solarized'
|
||||
let g:airline_section_y = '%{hostname()}'
|
||||
let g:airline_section_b = '%{fugitive#statusline()}'
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
call plug#end()
|
||||
Loading…
Add table
Add a link
Reference in a new issue