-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxvimrc
110 lines (95 loc) · 3.56 KB
/
xvimrc
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
" .xvimrc Configuration for XVim on Xcode
" Author: Paul Fioravanti <[email protected]>
" Source: https://github.com/paulfioravanti/dotfiles/blob/master/xvimrc
" Based on my .vimrc file
"
" NOTES:
" - <leader> command substituted out explicitly for , as XVim does not
" support the leader key (https://github.com/XVimProject/XVim/issues/669)
" ======================================================================
" General Config
" ======================================================================
" Make tabs insert spaces
set expandtab
" no status bar
set laststatus=0
" Display relative numbers all the time
set relativenumber
" Share system clipboard with unnamed register
set clipboard=unnamed
" Disable cursor blinking
set noblinkcursor
" =====================================================================
" Moving around, searching and patterns
" ======================================================================
" Search case-sensitively if search string includes uppercase
set smartcase
" searches are case insensitive
set ignorecase
" adjust autocomplete words depending on typed text
set infercase
" Show search pattern as it is typed
set incsearch
" Highlight searches
set hlsearch
" Clear all search matches
noremap ,<space> :nohlsearch<cr><cr>
" Keep search matches in the middle of the window.
nnoremap n nzzzv
nnoremap N Nzzzv
" Same when jumping around
nnoremap g; g;zz
nnoremap g, g,zz
nnoremap <c-o> <c-o>zz
" Simpler window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" ======================================================================
" Syntax, highlighting and spelling
" ======================================================================
nnoremap ,ww mz:%s/\s+$//g<cr>:w<cr>
" ======================================================================
" Mapping
" ======================================================================
" Poor man's surround.vim
nnoremap ,` gewi`<ESC>ea`<ESC>
nnoremap ,' gewi'<ESC>ea'<ESC>
nnoremap ," gewi"<ESC>ea"<ESC>
" Don't lose selection on indenting
vnoremap > >gv
vnoremap < <gv
" ======================================================================
" Xcode Mappings
" ======================================================================
" Reference here for the Menu item mappings:
" https://github.com/XVimProject/XVim/blob/master/Documents/Developers/MenuActionList.txt
" xccmd statement with the action names don't seem to be working for me, so
" just do as the XVim documentation commands and prefer the use of xcmenucmd:
" https://github.com/XVimProject/XVim/blob/master/Documents/Users/FeatureList.md#xvim-original-commands
" Code commenting like tpope/vim-commentary
nnoremap gcc :xcmenucmd Comment Selection<cr>
vnoremap gc :xcmenucmd Comment Selection<cr>
" Toggle Toolbars
nnoremap ,<C-h> :xcmenucmd Show Navigator<CR>
nnoremap ,<C-j> :xcmenucmd Show Debug Area<CR>
nnoremap ,<C-l> :xcmenucmd Show Utilities<CR>
" Navigation
" Open Quickly kind of approximates Command-T...
nnoremap ,t :xcmenucmd Open Quickly...<CR>
" Go to next issue
nnoremap ,n :nissue<CR>
" Go to previous issue
nnoremap ,p :pissue<CR>
nnoremap ,i :xcmenucmd Jump to Generated Interface<CR>
" Show
nnoremap ,g :xcmenucmd Show Previous History<CR>
nnoremap ,F :xcmenucmd Show in Finder<CR>
nnoremap ,D :xcmenucmd Documentation and API Reference<CR>
" Show inline documentation for wherever the cursor is
nnoremap ,d :xcmenucmd Quick Help for Selected Item<CR>
" Make
nnoremap ,R :xcmenucmd Run<CR>
" Set breakpoint at current line
nnoremap ,b :xcmenucmd Add Breakpoint at Current Line<CR>