summaryrefslogtreecommitdiffstats
path: root/vim/vimrc
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-09-10 21:00:29 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-09-10 21:00:29 +0100
commit3b146f1ac224f2b289bf64202dc2d85cc651c9f3 (patch)
tree262f7a656ede2818fa0231fc2fcda373915dd3b3 /vim/vimrc
parent1ff8823c348a92334f3332bfe2863dd191fb31eb (diff)
merged changes from desktop arch vimrc
Diffstat (limited to '')
-rw-r--r--vim/vimrc139
1 files changed, 112 insertions, 27 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 3ff2b4c..63c2665 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -6,6 +6,117 @@ runtime! plugin/sensible.vim
set nocompatible
set backspace=indent,eol,start
+set cmdheight=1
+set foldmethod=manual
+set encoding=utf-8
+set modelines=0
+set relativenumber
+set autoindent
+set showmode
+set nocursorline
+set ttyfast
+"set ttimeout
+set notimeout
+set nottimeout
+set backspace=indent,eol,start
+set laststatus=2
+set history=1000 " remember more commands and search history
+set undolevels=1000 " use many muchos levels of undo
+set wildignore=*.swp,*.bak,*.pyc,*.class
+set title " change the terminal's title
+set visualbell " don't beep
+set noerrorbells " don't beep
+set number
+set fillchars=diff:⣿,vert:\|
+set noswapfile
+set ruler " show the cursor position all the time
+set showcmd " display incomplete commands
+set vb
+"set list
+set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮
+set lazyredraw
+set matchtime=3
+set showbreak=↪
+set visualbell
+set noerrorbells
+set splitbelow
+set splitright
+set autowrite
+set linebreak
+set fileencodings=utf-8
+set ttyfast
+"set t_Co=256
+set background=dark
+set path+=**
+set relativenumber
+set incsearch
+set hlsearch
+set noswapfile
+
+" Searching and movement ...
+nnoremap / /\v
+vnoremap / /\v
+set ignorecase
+set smartcase
+set incsearch
+set showmatch
+set hlsearch
+set gdefault
+set scrolloff=3
+set sidescroll=1
+set sidescrolloff=10
+set virtualedit+=block
+nnoremap <leader><space> :noh<cr>:call clearmatches()<cr>
+
+" open a Quickfix window for the last search
+nnoremap <silent> <leader>/ :execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>
+
+
+"backups/swap
+set noswapfile
+set directory^=~/.vim/swap//
+set nobackup
+
+" persist the undo tree for each file
+set undofile
+set undodir^=~/.vim/undo//
+
+" Formatting, like Textmate
+nnoremap Q gqip
+"
+" Django ...
+augroup ft_django
+ au!
+ au BufNewFile,BufRead urls.py setlocal nowrap
+ au BufNewFile,BufRead urls.py normal! zR
+ au BufNewFile,BufRead dashboard.py normal! zR
+ au BufNewFile,BufRead local_settings.py normal! zR
+
+ au BufNewFile,BufRead admin.py setlocal filetype=python.django
+ au BufNewFile,BufRead urls.py setlocal filetype=python.django
+ au BufNewFile,BufRead models.py setlocal filetype=python.django
+ au BufNewFile,BufRead views.py setlocal filetype=python.django
+ au BufNewFile,BufRead settings.py setlocal filetype=python.django
+ au BufNewFile,BufRead settings.py setlocal foldmethod=marker
+ au BufNewFile,BufRead forms.py setlocal filetype=python.django
+ au BufNewFile,BufRead common_settings.py setlocal filetype=python.django
+ au BufNewFile,BufRead common_settings.py setlocal foldmethod=marker
+augroup END
+"
+" Mutt ...
+augroup ft_muttrc
+ au!
+
+ au BufRead,BufNewFile *.muttrc set ft=muttrc
+
+ au FileType muttrc setlocal foldmethod=marker foldmarker=,}}}
+augroup END
+"
+" General python properness ...
+autocmd FileType python set sw=4
+autocmd FileType python set ts=4
+autocmd FileType python set sts=4
+
syntax on
filetype indent on
filetype plugin on
@@ -65,17 +176,7 @@ nmap <silent> t<C-s> :TestSuite<CR>
"nmap <silent> t<C-l> :TestLast<CR>
nmap <silent> <S-F10> :TestLast<CR>
nmap <silent> t<C-g> :TestVisit<CR>
-
-"backups/swap
-set swapfile
-set directory^=~/.vim/swap//
-set writebackup
-set nobackup
-
-" persist the undo tree for each file
-set undofile
-set undodir^=~/.vim/undo//
-
+"
" wildignore
set wildignore=*.swp,*.bak,*.pyc,*.class
set wildignore+=.hg,.git,.svn " Version control
@@ -90,22 +191,6 @@ set wildignore+=migrations " Django migrations
set wildignore+=*.pyc " Python byte code
set wildignore+=*.orig " Merge resolution files
-set visualbell
-set noerrorbells
-set splitbelow
-set splitright
-set autowrite
-set linebreak
-set fileencodings=utf-8
-set ttyfast
-"set t_Co=256
-set background=dark
-set path+=**
-set relativenumber
-set incsearch
-set hlsearch
-set noswapfile
-
" make complete popupmenu better
set completeopt=longest,menuone