Skip to content

Commit

Permalink
Merge branch '3.0' of github.com:spf13/spf13-vim into 3.0
Browse files Browse the repository at this point in the history
# By Johnny Robeson (4) and others
# Via Steve Francia (11) and others
* '3.0' of github.com:spf13/spf13-vim: (22 commits)
  Removed screen program mapping
  Screen program mapping is now opt-in This as it slows down exit from insert mode for many users
  Delete .gitmodules
  rename BASE_DIR to APP_DIR
  add $app_dir var to point to application root
  Fix neosnippet and neosnippet-snippets order to follow the instructions at Shougo/neosnippet
  Add Shougo/neosnippet-snippets. Fixes spf13#539. Shougo/neosnippet version 4.1 split the repository into two and the other half is now missing, see the PR for details.
  rolled back some changes to ensure d0 and d^ match default behaviours, spf13#464
  fixed wrap relative motion mappings to address problem reported in spf13#464 , d$ now deletes last character of line
  added spf13 option to enable/disable wrap relative movement mappings
  fix spelling of occurred in debug()
  Fix no_conceal on youcompleteme
  bash requires the space in this case
  store the vundle uri in a variable.
  Correct load order of config files in readme
  add a switch to disable omni complete
  fixed formatting for readme windows install instructions
  Added Chocolatey install for ctags to readme for windows install
  modified windows install instructions in readme
  added instructions for windows install with Chocolatey
  ...

Conflicts:
	.vimrc
	bootstrap.sh
  • Loading branch information
raffone committed Feb 18, 2014
2 parents ff444cc + 65d344d commit a4b8f5f
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 119 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

146 changes: 77 additions & 69 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@
endif

" Setting up the directories {
if !exists('g:spf13_initialize_directories')
set backup " Backups are nice ...
if has('persistent_undo')
set undofile " So is persistent undo ...
set undolevels=1000 " Maximum number of changes that can be undone
set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
endif
set backup " Backups are nice ...
if has('persistent_undo')
set undofile " So is persistent undo ...
set undolevels=1000 " Maximum number of changes that can be undone
set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
endif

" To disable views add the following to your .vimrc.before.local file:
Expand Down Expand Up @@ -265,33 +263,44 @@
noremap j gj
noremap k gk
" Same for 0, home, end, etc
function! WrapRelativeMotion(key, ...)
let vis_sel=""
if a:0
let vis_sel="gv"
endif
if &wrap
execute "normal!" vis_sel . "g" . a:key
else
execute "normal!" vis_sel . a:key
endif
endfunction
" End/Start of line motion keys act relative to row/wrap width in the
" presence of `:set wrap`, and relative to line for `:set nowrap`.
" Default vim behaviour is to act relative to text line in both cases
" If you prefer the default behaviour, add the following to your
" .vimrc.before.local file:
" let g:spf13_no_wrapRelMotion = 1
if !exists('g:spf13_no_wrapRelMotion')
" Same for 0, home, end, etc
function! WrapRelativeMotion(key, ...)
let vis_sel=""
if a:0
let vis_sel="gv"
endif
if &wrap
execute "normal!" vis_sel . "g" . a:key
else
execute "normal!" vis_sel . a:key
endif
endfunction

" Map g* keys in Normal, Operator-pending, and Visual+select (over written
" below) modes
noremap $ :call WrapRelativeMotion("$")<CR>
noremap <End> :call WrapRelativeMotion("$")<CR>
noremap 0 :call WrapRelativeMotion("0")<CR>
noremap <Home> :call WrapRelativeMotion("0")<CR>
noremap ^ :call WrapRelativeMotion("^")<CR>
" Over write the Visual+Select mode mappings to ensure correct mode is
" passed to WrapRelativeMotion
vnoremap $ :<C-U>call WrapRelativeMotion("$", 1)<CR>
vnoremap <End> :<C-U>call WrapRelativeMotion("$", 1)<CR>
vnoremap 0 :<C-U>call WrapRelativeMotion("0", 1)<CR>
vnoremap <Home> :<C-U>call WrapRelativeMotion("0", 1)<CR>
vnoremap ^ :<C-U>call WrapRelativeMotion("^", 1)<CR>
" Map g* keys in Normal, Operator-pending, and Visual+select
noremap $ :call WrapRelativeMotion("$")<CR>
noremap <End> :call WrapRelativeMotion("$")<CR>
noremap 0 :call WrapRelativeMotion("0")<CR>
noremap <Home> :call WrapRelativeMotion("0")<CR>
noremap ^ :call WrapRelativeMotion("^")<CR>
" Overwrite the operator pending $/<End> mappings from above
" to force inclusive motion with :execute normal!
onoremap $ v:call WrapRelativeMotion("$")<CR>
onoremap <End> v:call WrapRelativeMotion("$")<CR>
" Overwrite the Visual+select mode mappings from above
" to ensure the correct vis_sel flag is passed to function
vnoremap $ :<C-U>call WrapRelativeMotion("$", 1)<CR>
vnoremap <End> :<C-U>call WrapRelativeMotion("$", 1)<CR>
vnoremap 0 :<C-U>call WrapRelativeMotion("0", 1)<CR>
vnoremap <Home> :<C-U>call WrapRelativeMotion("0", 1)<CR>
vnoremap ^ :<C-U>call WrapRelativeMotion("^", 1)<CR>
endif

" The following two lines conflict with moving to top and
" bottom of the screen
Expand Down Expand Up @@ -362,13 +371,6 @@
" http://stackoverflow.com/a/8064607/127816
vnoremap . :normal .<CR>
" Fix home and end keybindings for screen, particularly on mac
" - for some reason this fixes the arrow keys too. huh.
"map  $
"imap  $
"map  g0
"imap  g0

" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
Expand Down Expand Up @@ -410,28 +412,32 @@
" }

" OmniComplete {
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\if &omnifunc == "" |
\setlocal omnifunc=syntaxcomplete#Complete |
\endif
endif
" To disable omni complete, add the following to your .vimrc.before.local file:
" let g:spf13_no_omni_complete = 1
if !exists('g:spf13_no_omni_complete')
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\if &omnifunc == "" |
\setlocal omnifunc=syntaxcomplete#Complete |
\endif
endif

hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE

" Some convenient mappings
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
" Automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menu,preview,longest
hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE

" Some convenient mappings
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
" Automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menu,preview,longest
endif
" }

" Ctags {
Expand All @@ -457,7 +463,7 @@
" }

" NerdTree {
map <C-e> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
map <C-e> <plug>NERDTreeTabsToggle<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
Expand Down Expand Up @@ -572,7 +578,7 @@
nnoremap <silent> <leader>gi :Git add -p %<CR>
nnoremap <silent> <leader>gg :SignifyToggle<CR>
"}

" YouCompleteMe {
if count(g:spf13_bundle_groups, 'youcompleteme')
let g:acp_enableAtStartup = 0
Expand All @@ -584,7 +590,7 @@
let g:UltiSnipsExpandTrigger = '<C-j>'
let g:UltiSnipsJumpForwardTrigger = '<C-j>'
let g:UltiSnipsJumpBackwardTrigger = '<C-k>'

" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
Expand All @@ -602,8 +608,10 @@
endif

" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
if !exists("g:spf13_no_conceal")
if has('conceal')
set conceallevel=2 concealcursor=i
endif
endif

" Disable the neosnippet preview candidate window
Expand Down Expand Up @@ -772,7 +780,9 @@
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
" }
" Normal Vim omni-completion {
else
" To disable omni complete, add the following to your .vimrc.before.local file:
" let g:spf13_no_omni_complete = 1
elseif !exists('g:spf13_no_omni_complete')
" Enable omni-completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
Expand Down Expand Up @@ -879,7 +889,6 @@
" Functions {

" Initialize directories {
if !exists('g:spf13_initialize_directories')
function! InitializeDirectories()
let parent = $HOME
let prefix = 'vim'
Expand Down Expand Up @@ -920,7 +929,6 @@
endfor
endfunction
call InitializeDirectories()
endif
" }

" Initialize NERDTree as needed {
Expand Down
7 changes: 7 additions & 0 deletions .vimrc.before
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
" Disable easier moving in tabs and windows
" let g:spf13_no_easyWindows = 1

" Disable wrap relative motion for start/end line motions
" let g:spf13_no_wrapRelMotion = 1

" Disable fast tab navigation
" let g:spf13_no_fastTabs = 1

Expand Down Expand Up @@ -76,6 +79,9 @@
" To set your own font, do it from ~/.vimrc.local
" let g:spf13_no_big_font = 1

" Disable omni complete
" let g:spf13_no_omni_complete = 1

" Don't create default mappings for multicursors
" See :help multiple-cursors-mappings
" let g:multi_cursor_use_default_mapping=0
Expand All @@ -85,6 +91,7 @@
" let g:multi_cursor_quit_key='<Esc>'
" Require a special keypress to enter multiple cursors mode
" let g:multi_cursor_start_key='+'

" }

" Use fork before if available {
Expand Down
2 changes: 2 additions & 0 deletions .vimrc.bundles
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@
elseif count(g:spf13_bundle_groups, 'neocomplcache')
Bundle 'Shougo/neocomplcache'
Bundle 'Shougo/neosnippet'
Bundle 'Shougo/neosnippet-snippets'
Bundle 'honza/vim-snippets'
elseif count(g:spf13_bundle_groups, 'neocomplete')
Bundle 'Shougo/neocomplete.vim.git'
Bundle 'Shougo/neosnippet'
Bundle 'Shougo/neosnippet-snippets'
Bundle 'honza/vim-snippets'
endif
" }
Expand Down
26 changes: 20 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ If you have a bash-compatible shell you can run the script directly:

## Installing on Windows

On Windows and \*nix [Git] and [Curl] are required. Also, if you haven't already, you'll need to install [Vim].
On Windows and \*nix [Git] and [Curl] are required. Also, if you haven't already, you'll need to install [Vim].
The quickest option to install all three dependencies ([Git], [Curl], [Vim] and [spf13-vim]) via [Chocolatey] NuGet and the [spf13.vim package]. After running the [Chocolatey] install, execute the following commands on the _command prompt_:

cinst git
cinst curl
cinst ctags
cinst spf13.vim

_Note: The spf13.vim package will install Vim also! _

If you want to install [msysgit], [Curl] and [spf13-vim] individually, follow the directions below.

### Installing dependencies

Expand Down Expand Up @@ -169,11 +179,12 @@ There is an additional tier of customization available to those who want to main
fork of spf13-vim specialized for a particular group. These users can create `.vimrc.fork`
and `.vimrc.bundles.fork` files in the root of their fork. The load order for the configuration is:

1. `.vimrc.before.local` - before user configuration
1. `.vimrc.before` - spf13-vim before configuration
2. `.vimrc.before.fork` - fork before configuration
3. `.vimrc.bundles.local` - local user bundle configuration
4. `.vimrc.bundles.fork` - fork bundle configuration
5. `.vimrc.bundles` - spf13-vim bundle configuration
3. `.vimrc.before.local` - before user configuration
4. `.vimrc.bundles` - spf13-vim bundle configuration
5. `.vimrc.bundles.fork` - fork bundle configuration
6. `.vimrc.bundles.local` - local user bundle configuration
6. `.vimrc` - spf13-vim vim configuration
7. `.vimrc.fork` - fork vim configuration
8. `.vimrc.local` - local user configuration
Expand Down Expand Up @@ -297,7 +308,7 @@ NeoComplCache is an amazing autocomplete plugin with additional support for snip

YouCompleteMe is another amazing completion engine. It is slightly more involved to set up as it contains a binary component that the user needs to compile before it will work. As a result of this however it is very fast.

To enable YouCompleteMe add `YouCompleteMe` to your list of groups by overriding it in your `.vimrc.bundles.local` like so: `let g:spf13_bundle_groups=['general', 'programming', 'misc', 'scala', 'YouCompleteMe']` This is just an example. Remember to choose the other groups you want here.
To enable YouCompleteMe add `youcompleteme` to your list of groups by overriding it in your `.vimrc.before.local` like so: `let g:spf13_bundle_groups=['general', 'programming', 'misc', 'scala', 'youcompleteme']` This is just an example. Remember to choose the other groups you want here.

Once you have done this you will need to get Vundle to grab the latest code from git. You can do this by calling `:BundleInstall!`. You should see YouCompleteMe in the list.

Expand Down Expand Up @@ -491,6 +502,8 @@ Here's some tips if you've never used VIM before:
[Curl]:http://curl.haxx.se
[Vim]:http://www.vim.org/download.php#pc
[msysgit]:http://code.google.com/p/msysgit
[Chocolatey]: http://chocolatey.org/
[spf13.vim package]: http://chocolatey.org/packages/spf13.vim
[MacVim]:http://code.google.com/p/macvim/
[spf13-vim]:https://github.com/spf13/spf13-vim
[contributors]:https://github.com/spf13/spf13-vim/contributors
Expand All @@ -515,6 +528,7 @@ Here's some tips if you've never used VIM before:
[Airline]:https://github.com/bling/vim-airline
[Powerline]:https://github.com/lokaltog/powerline
[Powerline Fonts]:https://github.com/Lokaltog/powerline-fonts
[AutoClose]:https://github.com/spf13/vim-autoclose

[spf13-vim-img]:https://i.imgur.com/UKToY.png
[spf13-vimrc-img]:https://i.imgur.com/kZWj1.png
Expand Down
17 changes: 9 additions & 8 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash
############################ SETUP PARAMETERS
app_name='spf13-vim'
git_uri='https://github.com/raffone/spf13-vim.git'
app_dir="$HOME/.spf13-vim-3"
[ -z "$git_uri" ] && git_uri='https://github.com/spf13/spf13-vim.git'
git_branch='3.0'
debug_mode='0'
fork_maintainer='0'
[ -z "$VUNDLE_URI" ] && VUNDLE_URI="https://github.com/gmarik/vundle.git"

############################ BASIC SETUP TOOLS
msg() {
Expand All @@ -24,7 +26,7 @@ error() {

debug() {
if [ "$debug_mode" -eq '1' ] && [ "$ret" -gt '1' ]; then
msg "An error occured in function \"${FUNCNAME[$i+1]}\" on line ${BASH_LINENO[$i+1]}, we're sorry for that."
msg "An error occurred in function \"${FUNCNAME[$i+1]}\" on line ${BASH_LINENO[$i+1]}, we're sorry for that."
fi
}

Expand Down Expand Up @@ -63,7 +65,7 @@ upgrade_repo() {
msg "trying to update $1"

if [ "$1" = "$app_name" ]; then
cd "$HOME/.$app_name-3" &&
cd "$app_dir" &&
git pull origin "$git_branch"
fi

Expand All @@ -79,10 +81,9 @@ upgrade_repo() {

clone_repo() {
program_exists "git" "Sorry, we cannot continue without GIT, please install it first."
endpath="$HOME/.$app_name-3"

if [ ! -e "$endpath/.git" ]; then
git clone --recursive -b "$git_branch" "$git_uri" "$endpath"
if [ ! -e "$app_dir" ]; then
git clone --recursive -b "$git_branch" "$git_uri" "$app_dir"
ret="$?"
success "$1"
debug
Expand All @@ -93,7 +94,7 @@ clone_repo() {

clone_vundle() {
if [ ! -e "$HOME/.vim/bundle/vundle" ]; then
git clone https://github.com/gmarik/vundle.git "$HOME/.vim/bundle/vundle"
git clone $VUNDLE_URI "$HOME/.vim/bundle/vundle"
else
upgrade_repo "vundle" "Successfully updated vundle"
fi
Expand All @@ -103,7 +104,7 @@ clone_vundle() {
}

create_symlinks() {
endpath="$HOME/.$app_name-3"
endpath="$app_dir"

if [ ! -d "$endpath/.vim/bundle" ]; then
mkdir -p "$endpath/.vim/bundle"
Expand Down
Loading

0 comments on commit a4b8f5f

Please sign in to comment.