Disclaimer: I'm new to vim/tmux. I'm on a Mac using MacVim I was told to use version control on my dotfiles.
Before my dot files were all placed in my root ~ like so:
~/
.vimrc
.tmux.conf
.vim
/bundle
/autoload
.viminfo
etc
But then I figured it would be a good idea to make a folder named "dotfiles", and house them all in there and then upload it to github so I can have them anywhere.
Like so:
~/
/dotfiles
.vimrc
.tmux.conf
.vim
/bundle
/autoload
.viminfo
etc
At first I thought everything was okay, becuase I never closed Vim, but when I reloaded it later, I realized none of my commands were working anymore. So I went in an changed some paths in my .vimrc
and in my .tmux.conf
in hopes that it would work again, but no luck.
Here is my full .vimrc:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/dotfiles/.vim/bundle/Vundle.vim
call vundle#begin()
" " alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
"
" " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'christoomey/vim-tmux-navigator'
" " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" " To ignore plugin indent changes, instead use:
" "filetype plugin on
" "
" " Brief help
" " :PluginList - lists configured plugins
" " :PluginInstall - installs plugins; append `!` to update or just
" :PluginUpdate
" " :PluginSearch foo - searches for foo; append `!` to refresh local cache
" " :PluginClean - confirms removal of unused plugins; append `!` to
" auto-approve removal
" "
" " see :h vundle for more details or wiki for FAQ
" " Put your non-Plugin stuff after this line
execute pathogen#infect()
syntax on
filetype plugin indent on
set mouse=a
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
nnoremap <silent> <c-/> :TmuxNavigatePrevious<cr>
let g:tmux_navigator_save_on_switch = 1
vnoremap <C-c> "*y
set runtimepath^=~/dotfiles/.vim/bundle/ctrlp.vim
As you can see, the paths have been corrected to incorporate the /dotfiles/
directory, yet anytime I try to run a plugin or something in my .vimrc, I get a generic 'Not an editor command'
error.
Incidentally, tmux and all its configuration seems to be working fine after it being moved around.
Any Ideas?
Maybe you should turn to the people who told you to do that for support, don't you think?
Putting all your dotfiles in a single repo is not a requisite or even an objectively good idea. It could work for some people but only if you manage to point your programs to that centralized place (great) or if you symlink those files to their regular location (which kind of defeats the point). The people who told you to use version control on your dotfiles should have told you how to do that from start to finish.
Vim expects your
vim
directory and yourvimrc
to be in default locations:It won't look elsewhere so you'll have to symlink them from your repo to their expected location: