-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
113 lines (89 loc) · 3.24 KB
/
.ideavimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
"""""""""""""
" ideavimrc "
"""""""""""""
" Adapted or copied from my main vimrc
" General options {{{
"""""""""""""""""""""
set autoread " Set to auto read when a file is changed
set autowrite " Automatically save before commands like :next and :make
set backupcopy=yes " Preserve hard links when making copies
set confirm " Instead of failing a command, raise a dialog asking what to do
set encoding=utf8 " Set default encoding
set fileformats=unix,dos " Set Unix as the standard line ending
set foldlevelstart=3 " How many folds to show at file open
set hidden " Hide buffers when they are abandoned
set hlsearch " Highlight matches when searching
set incsearch " Incremental search
set lazyredraw " Don't redraw when running macros
set magic " Use traditional regular expressions (see wiki)
set matchtime=1 " How many tenths of a second to blink when matching brackets
set mouse=n " Enable mouse usage (normal mode only)
set nocompatible " Disable vi compatibility options
set noshowmode " Powerline does this for me, so disable the default mode
set nosmartindent " Prevent audo dedent on Python comment
set ruler " Display the bar at the bottom
set secure " Shell and write commands are disallowed in local vimrcs
set shell=/bin/bash " Use bash as the vim shell
set showcmd " Show (partial) command in status line
set showmatch " Show matching brackets
set smartcase " Do smart case matching
set smarttab " Use smart tabbing
set tabpagemax=500 " Maximum number of tabs
set timeoutlen=50 " To prevent the lag on 'O'
set undolevels=10000 " Allow for 10,000 undos
set wrap " Wrap long lines
" Set leader key
let mapleader = '\'
" }}}
" Appearance {{{
""""""""""""""""
" Linebreak at 500 characters
set linebreak
set textwidth=500
" Set relative line numbers
set number
set relativenumber
" }}}
" Behavior settings {{{
"""""""""""""""""""""""
" Where split files should go
set splitbelow
set splitright
" How many lines of history to remember
set history=1000
" Print whitespace
set list listchars=tab:»\ ,trail:·
" Have backspace actually go backwards
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" Append newlines to files if missing
set fixeol
" }}}
" New commands {{{
""""""""""""""""""
" Search for merge conflict markers
command MergeFail :/^\(<<<<<<<\|=======\|>>>>>>>\)
" Useful mappings for managing tabs
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove<Space>
" Open a new tab (\te has the current buffer's path)
map <leader>tn :tabnew<Space>
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch the cwd to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Switch the cwd to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" System clipboard
nmap <leader>p "+p
nmap <leader>P "+P
nmap <leader>y "+y
nmap <leader>x "+x
nmap <leader>d "+d
vmap <leader>p "+p
vmap <leader>P "+P
vmap <leader>y "+y
vmap <leader>x "+x
vmap <leader>d "+d
" }}}
" vim: set ts=2 sw=2 fdm=marker foldlevel=0: