1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Tidy up vimrc and improve autosaving

This commit is contained in:
Joe Groocock 2017-11-26 00:57:47 +00:00
parent a24abd9de5
commit 2dac4b461f
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -4,9 +4,11 @@ set nocompatible " be iMproved, required
set rtp+=~/.config/vim set rtp+=~/.config/vim
set directory=.,~/.config/vim set directory=.,~/.config/vim
set viminfo+=n~/.config/vim/viminfo set viminfo+=n~/.config/vim/viminfo
set directory=$HOME/.config/vim/swapfiles//
syntax enable syntax enable
filetype plugin on filetype plugin on
set tabstop=4 set tabstop=4
set shiftwidth=0 " Use tabstop set shiftwidth=0 " Use tabstop
set softtabstop=-1 " Use tabstop set softtabstop=-1 " Use tabstop
@ -17,12 +19,9 @@ set number
set linebreak set linebreak
set autoindent set autoindent
set laststatus=2 set laststatus=2
set mouse=nicr
set encoding=utf-8 set encoding=utf-8
set background=dark set background=dark
set directory=$HOME/.config/vim/swapfiles//
set omnifunc=syntaxcomplete#Complete set omnifunc=syntaxcomplete#Complete
set title set title
set clipboard=unnamed set clipboard=unnamed
set wildmenu set wildmenu
@ -32,11 +31,11 @@ set ttyfast
set autoread set autoread
set showmatch set showmatch
set scrolloff=6 set scrolloff=6
set autowriteall
set nojoinspaces set nojoinspaces
nnoremap <LeftMouse> <nop> " Autosave settings
nnoremap <RightMouse> <nop> set autowrite
autocmd InsertLeave * save
" Search options " Search options
set hlsearch set hlsearch
@ -52,6 +51,7 @@ set list
set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:<
highlight SpecialKey ctermfg=7 highlight SpecialKey ctermfg=7
" set the runtime path to include Vundle and initialize " set the runtime path to include Vundle and initialize
set rtp+=~/.config/vim/bundle/Vundle.vim set rtp+=~/.config/vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
@ -64,7 +64,6 @@ Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rhubarb' Plugin 'tpope/vim-rhubarb'
Plugin 'tpope/vim-abolish' Plugin 'tpope/vim-abolish'
Plugin 'vim-scripts/vim-auto-save'
Plugin 'airblade/vim-gitgutter' Plugin 'airblade/vim-gitgutter'
Plugin 'ryanoasis/vim-devicons' Plugin 'ryanoasis/vim-devicons'
Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline'
@ -87,15 +86,18 @@ let g:airline_powerline_fonts = 1
let g:airline_theme='solarized' let g:airline_theme='solarized'
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
" vim-auto-save
let g:auto_save = 1 " enable AutoSave on Vim startup
" vim-markdown plugin " vim-markdown plugin
let vim_markdown_preview_toggle=0 let vim_markdown_preview_toggle=0
let vim_markdown_preview_browser='Chromium' let vim_markdown_preview_browser='Chromium'
let vim_markdown_preview_use_xdg_open=1 let vim_markdown_preview_use_xdg_open=1
let vim_markdown_preview_github=1 let vim_markdown_preview_github=1
" Disable mouse
set mouse=nicr
nnoremap <LeftMouse> <nop>
nnoremap <RightMouse> <nop>
let mapleader="\<space>" let mapleader="\<space>"
" Unbind arrow keys " Unbind arrow keys
for prefix in ['n', 'v'] for prefix in ['n', 'v']
@ -160,7 +162,7 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1)
" Remappings for the T key " Remappings for the T key
noremap j t noremap j t
noremap J T "noremap J T
" Remapping for the L key " Remapping for the L key
noremap l n noremap l n
@ -182,12 +184,6 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1)
endif endif
" Interface with system clipboard
noremap <Leader>y "*y
noremap <Leader>p "*p
noremap <Leader>Y "+y
noremap <Leader>P "+p
" Save aliases. " Save aliases.
noremap <Leader>q :wq<CR> noremap <Leader>q :wq<CR>
com W w com W w