Having recently gotten 'serious'(-ish) about using Vim, I was really pleased to come across the 'VimRooom' script.
Problem
The problem is that I've also just discovered the langmap option for re-configuring the hjkl keys and there seems to be some sort of conflict which stops the new configuration of movement keys from working with Vimroom toggled on.
Question
I'm afraid to say that I don't understand the langmap command enough to know why such a conflict is possible and I was hoping someone could explain the problem/suggest a fix please?
My current .vimrc:
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
" My Bundles here:
"Bundle 'flazz/vim-colorschemes'
"Bundle 'vim-scripts/CSApprox'
Bundle 'altercation/vim-colors-solarized'
Bundle 'dnebauer/AutomaticLaTeXPlugin'
Bundle 'mikewest/vimroom'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
" Colour scheme options
syntax on
set background=dark
set t_Co=16
let g:solarized_termcolors=16
colorscheme solarized
"Line formatting options
set linebreak
set tw=100
set fo+=t
"set foldcolumn=12
set tabstop=4
"Basic Keybindings
"Movement
set langmap=hk,mj,th,nl,kt,jm,ln
"Display options
set scrolloff=999
"Settings for Automatic LaTeX
filetype plugin on
filetype indent on
filetype on
"Search Settings
set smartcase
"Vimroom Settings
let g:vimroom_sidebar_height=0
N.B. The desired hjkl remapping(for lack of a better phrase) only makes sense when using the Dvorak layout.
Related
I followed Ethan's Guides for configuring solarized. In particular I:
Downloaded and set his Solarized Dark ansi profile for OS X Terminal
Downloaded and moved solarized theme to vim/colors
I then added the two lines set background=dark and colorscheme solarized to my vimrc
Also downloaded macvim and linked vim to macvims vim
After doing this I get an ugly vim with green lines and the colors are not quite right. I tried using the 256 color version also with adding the option let g:solarized_termcolors=256 and while it looked a little better it wasn't quite right and I would rather do it the native way with the solarized terminal theme + ansi colors.
Ugly Solarized Result
macOS Terminal Profile Set
Also here is my vimrc:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" javascript syntax highlighting
Plugin 'jelera/vim-javascript-syntax'
" indentation help
Plugin 'pangloss/vim-javascript'
Plugin 'nathanaelkane/vim-indent-guides'
" bracket and quote help
Plugin 'Raimondi/delimitMate'
" YouCompleteMe
Plugin 'Valloric/YouCompleteMe'
" Tern
Plugin 'marijnh/tern_for_vim'
" Surround.vim
Plugin 'tpope/vim-surround'
" Fuzzy file search
Plugin 'kien/ctrlp.vim'
call vundle#end() " required
filetype plugin indent on " required
" map ctrl + c to automatically delimit brackets and quotes
imap <C-c> <CR><Esc>O
" fuck ex mode
nnoremap Q <nop>
" you complete me tweaks
let g:ycm_add_preview_to_completeopt=0
let g:ycm_confirm_extra_conf=0
set completeopt-=preview
" general options
syntax on
set number
set expandtab
set tabstop=2
set shiftwidth=2
set guifont=Menlo:h12
set background=dark
colorscheme solarized
set showbreak=↪
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
Solarized can't look "right" in a terminal emulator advertising itself as "256color-ready" because not a single color in its palette matches with any of colors 16-255 of the standard xterm palette. Contrary to what the official blurb might make you think, the Solarized palette is very poorly suited for terminal usage and the Vim colorscheme is not very well written at all so don't get too dreamy about that typical blue background.
That said, there are two hypothetical ways to make Solarized look "right" in a terminal:
set up colors 0-15 of your terminal emulator and make sure both Solarized and Vim only use those colors,
or, if your terminal emulator and your Vim build allow it, use :help 'termguicolors' to force Vim to use "true colors". Hint: Terminal.app doesn't support that feature.
Your Solarized terminal palette is broken: those are the default colors, not the Solarized colors.
Don't waste your time on that crap. There are plenty of competently written colorschemes at your disposal.
I'm running Arch and I'm trying to use Vundle to install plugins.
Here's my ~/.vimrc
filetype off
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree'
Plugin 'Valloric/YouCompleteMe'
Plugin 'bling/vim-airline'
Plugin 'pangloss/vim-javascript'
call vundle#end()
filetype plugin indent on " Treba nam da Vim prepoznaje filetype
syntax on " Uključujemo syntax highlighting
set tabstop=4 " Broj razmaka koji tab stavlja
set shiftwidth=4 " Razmaci za autoindent
set autoindent " Auto indent!
set expandtab " Stavlja razmake umjesto taba
set smarttab " Dodatna carolija
set number " Line numbers!
set showmatch " Kada je zagrada umetnuta, na sekundu
" skoči do njenog para.
set ruler " Pokazuje Line/column brojeve
set background=dark " Lepo tamno bre
Now when I run vim +PluginInstall +qall it only seems to install VundleVim/Vundle.vim. But when I :so ~/.vimrc and reinstall it does it correctly, but the plugins never show up.
:set rtp also displays all the paths to ~/.vim/bundle but they still don't show up. I've tried reinstalling vim, but to no avail. What should I do?
Edit #1: Updated ~/.vimrc to include VundleVim/Vundle.vim.
According to the Vundle README, before any other plugins, you have to let Vundle manage itself:
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Typing :VundleInstall worked for me. I spent a long time doing :PluginInstall, but I think once you have Vundle installed (you can check by typing :PluginList), you can do :VundleInstall
I have the error E117 when I exec PluginInstall,because 'set rtp' is not work, the solution is move the runtime! debian.vimcommond to the top of the .vimrc
Vim-newbie here...
I've been learning vim at work using a Mac.
I added my .vimrc to my github repo and expected Vundle to
download everything and have vim working the same on my home Mint 13 laptop.
I've linked my ~/.vim/.vimrc to ~/.vimrc.
I followed these instructions for building vim 7.4 and having a working vim.
I know that some parts of the .vimrc file are read, b/c my
remapped esc sequence is working.
Nothing else appears to work, not even line numbers.
vim --version
vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 25 2015 20:30:46)
Included patches: 1-640
vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
Bundle 'nanotech/jellybeans.vim'
Bundle 'tpope/vim-fugitive'
Bundle 'flazz/vim-colorschemes'
Bundle 'fs111/pydoc.vim'
Bundle 'hdima/python-syntax'
Bundle 'scrooloose/nerdtree'
Bundle 'tmhedberg/SimpylFold'
Bundle 'scrooloose/syntastic'
Bundle 'kien/rainbow_parentheses.vim'
call vundle#end() " required
filetype plugin indent on " required
syntax enable
set foldmethod=indent
set foldlevel=99
setlocal foldmethod=indent
set background=dark
set tabstop=4
set expandtab
set shiftwidth=4
set shiftround
set number
let mapleader=","
set hlsearch
set mouse=a
set nojoinspaces
set smarttab
nnoremap <leader>n :NERDTree<CR>
imap fj <Esc>
colorscheme jellybeans
" rainbow parens
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
It would appear, that once again I've been bitten by XFCE.
This link gave me the hint I needed, setting my terminal
colos with:
set t_Co=256
Now more features are working as I expected, except that the color scheme
jellybeans is no longer so great.
Rainbowparens is not working.
EDIT:
Using more colors allows rainbow parens to work...
set t_Co=512
I installed YouCompleteMe using vundle.
Then installed all plugins and installed YCM using
./install.sh --clang-completer
This is how my vimrc looks:
syntax on
set expandtab
set cindent
set tabstop=4
retab
set shiftwidth=4
set hlsearch
set paste
set ic
set number
colorscheme molokai
set t_Co=256
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'kien/ctrlp.vim'
Plugin 'sjl/gundo.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'Valloric/ListToggle'
call vundle#end() " required
filetype plugin indent on
"options for syntastic"
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_python_checkers=['pep8', 'pylint', 'python']
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_error_symbol = "X"
let g:syntastic_style_error_symbol = ">"
let g:syntastic_warning_symbol = "!"
let g:syntastic_style_warning_symbol = ">"
let g:syntastic_echo_current_error=1
let g:syntastic_enable_balloons = 1
let g:syntastic_auto_jump=1
"Gundo options"
nnoremap <F5> :GundoToggle<CR>
"CtrlP options"
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
"Powerline stuff"
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
set laststatus=2
YCM works but I can't switch between the suggestions using TAB, only using Down and Up arrows and accepting with Enter.
Why is happening this? Is another program using the TAB key?
thanks a lot for the help
By configuring set paste, you're effectively disabling all mappings and abbreviations.
You only need that set when you actually paste text in terminal Vim! It's best to bind this to a key. As mappings cannot be used when the option is set, Vim provides a special option for this:
:set pastetoggle=<F10>
Further commentary
As the ~/.vimrc is sourced at the beginning of Vim startup (when files passed to it haven't yet been loaded), the retab is ineffective; just drop it. If you really want automatic reindenting for opened files, you'd have to employ an :autocmd BufRead * retab for that, but I'd advise against that.
The problem was due to the "set paste" line in my .vimrc
so, I removed it, and when I want to paste large blocks of code in vim, I just write :set paste to enable it or :set nopaste to disable it. This toggle can be also mapped to f10 or any key.
Hi I have been trying to configure vim on ubuntu.
All the packages seem to install fine. However if installing a colorscheme via vundle and then using colorscheme name it doesn't appear to find the scheme.
I have attempted to install railscasts, solarized and desert-warm but all have failed to load.
This is my .vimrc am I doing something wrong?
set nocompatible " be iMproved
filetype off " required!
colorscheme desert-warm
" next tab
map <F7> :tabn
" previous tab
map <F8> :tabp
" Close Tab abd save
map <F9> ZZ
" open and edit file
map <F6> :tabedit
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
Bundle 'desert-warm-256'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
Bundle 'https://github.com/vim-scripts/perl-support.vim.git'
Bundle 'https://github.com/Raimondi/delimitMate.git'
Bundle 'https://github.com/altercation/vim-colors-solarized.git'
Bundle 'https://github.com/jpo/vim-railscasts-theme.git'
" ...
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
Try moving the colorscheme call to the end of the file.
Also, the color scheme name from your example doesn't work for me—it should be colorscheme desert-warm-256. To see a list of color schemes currently installed, try entering :colorscheme <TAB> interactively.
I think the answer to this question is that there is no call vundle#end() or syntax on in the original poster's .vimrc.
Adding these two lines and for example the colorscheme solarized line anywhere after the call vundle#end() would have solved the issue.
colorscheme desert-warm must come after Bundle 'desert-warm-256' since it is the Bundle command that adds things to the path:
Bundle 'desert-warm-256'
colorscheme desert-warm
Source: same question on GitHub issue.
Note: Vundle has recently (2014-03-18) swapped to using Plugin instead of Bundle, so after you git pull it will be:
Plugin 'desert-warm-256'
colorscheme desert-warm
You should write your "colorsheme desert bla bla" line AFTER the Plugin line. Because Vundle first needs to install this color plugin, and after than it can use it. Sorry my tiresome English.