4 ms·
That's one thing that worries me about using vim full-time: if I become reliant on a .vimrc or a set of plugins to use vim effectively, but I'm on a computer th
by LeafStorm 15y ago
That's one thing that worries me about using vim full-time: if I become reliant on a .vimrc or a set of plugins to use vim effectively, but I'm on a computer that doesn't have my .vimrc on it, I'm doomed.
- oops 15y agoWhat editor do you use now?
- ldh 15y agoDoes that computer have a network connection? Just store your plugins and settings in a git repo (a good idea anyway) and pull them down on whatever machine you're using.
- agscala 15y agoThis is what I do. I can clone a git repo, run an install script, and have my typical vim setup running in a trivial amount of time.
- stevelosh 15y agoSame here. cd hg clone http://bitbucket.org/sjl/dotfiles .dotfiles ln -s `pwd`/.dotfiles/vim/.vimrc ~/.vimrc cd - My full Vim config is now installed, plugins included thanks to Mercurial's subrepos. But really, I don't find myself editing files directly on servers all that often. And when I do I usually prefer bcvi anyway, because I can use MacVim instead of Vim through a terminal (which I hate because of all the shadowed keys).
- ansible 15y agoRather than type in the symbolic link commands, I just have a config script that I run (also checked into version control) that will move the old .vim directory, .bashrc, and other files out of the way, and install links to the version controlled file instead. Easy.
- tuxcanfly 15y agoI use this ruby script: https://github.com/technicalpickles/homesick https://github.com/technicalpickles/homesick
- zmanji 15y agoThis is why people place them on github or bitbucket. So it is very easy to clone the repo locally and then use the .vimrc. It is something you only have to do once per machine.
- rudenoise 15y agoI totally agree. Personally I take the Robert De Niro approach: "...become attached to nothing in life that you can't walk away from in 30 seconds if you spot the "Heat" around the corner." Except I apply this to customised/complicated software rather than "things" in my life.
- loire280 15y agoThis is why I stick pretty close to stock vim - I use it on too many remote systems to worry about keeping my environment consistent. I could automate something, and maybe when our sysadmin finishes integrating puppet into our servers I can use that, but in the meantime, my .vimrc is just syntax highlighting and tab settings.
- billybob 15y agoI feel exactly the opposite. The previous editors that I used required configuration through a menu system. I wouldn't have known how to take that with me elsewhere. With Vim, all my configuration is in files, which can be backed up. I have them in a dotfiles repo on Github. As I make tweaks, I regularly pull and push from my various computers and they are always up to date. If I'm on a computer that doesn't have my .vimrc, I'm just a `git pull` away from having it. (Same goes for zsh config, etc.) The most likely time for me not to have my .vimrc is when sshing into a server, in which case I can use stock vim just fine. If my main editor were a GUI, I wouldn't have it available at all, so I think Vim has a leg up in that, too.
- billybob 15y agoBy the way, if you're ever confused about what behavior is native and what comes from your config, use the `-u "NONE"` option to run vanilla vim (or macvim or gvim).
- secoif 15y agoyou can get around this by editing remote files with your vim over scp http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vi...
- bostonvaulter2 15y agoI do the same thing. But I also have customized branches to work with my config. I will usually make new commits on the computer-specific branch and then cherry pick the commits to master and then rebase the computer-specific branch on top of master. This can get a little repetitive and result in my computer-specific branches getting very out of date so I wrote a bash script called git-update to streamline this process for me. Here's the code: https://github.com/axelson/git-update https://github.com/axelson/git-update
- sjs 15y agoI run wget -qO - bit.ly/newbox | sh or curl -Ls bit.ly/newbox | sh and am up and running. No sweat. I keep this stuff in Dropbox too, just in case.
- JoshTriplett 15y agoThat's a huge amount of trust you've placed in bit.ly, and in insecure http. You might at least consider typing out https://bit.ly/newbox https://bit.ly/newbox so that you only have to trust bit.ly. Better yet, memorize the URL that bit.ly links to. Also, why do you symlink your dotfiles into your cloned git repo, rather than just checking out the git repo as ~? Personally, I just move the .git directory from the clone to ~, and then "git checkout -f".
- sjs 15y agoI'm lazy and don't want to type out the github URL, but you're right I should place the redirection under my control and use HTTPS. Honestly though I cannot think of a single reason why anyone would want to hijack my script. I don't do anything very interesting that would make my machine a lucrative target for that sort of malicious activity. I'm a very small fish in a massive pond. Also due to laziness I don't want to add a bunch of stuff to .gitignore, or add * and then add exceptions. I like having the symlinks.
- mhansen 15y agoJust watch out that you don't get a 404 one day and end up piping a whole lot of error screen HTML into your shell, it could have wildly unpredictable results.
- gerrit 15y agoThere’s always git.io: https://github.com/blog/985-git-io-github-url-shortener https://github.com/blog/985-git-io-github-url-shortener
- jodoherty 15y agoI've basically memorized my .vimrc and .gvimrc files from retyping them over and over again, but then I take the approach of using the standard configuration when possible and only customizing the minimum required, so it's not as bad as it sounds. The power of VIM as an effective and consistent text editor is far more important to me than the power of VIM as a highly configurable editor.
- SandB0x 15y agoOn all my machines ~/.vimrc and friends are symlinked out from my Dropbox folder.
- loevborg 15y agoThis is what I do as well. To make thinks simpler, I use this script to automatically create the symlinks (if they are not already existant). If you put it in your `.zshrc`, you can run the command `dropbox-update-dotfiles` to make or update the symlinks. Not that this makes use of `zsh` extensions, so it requires adaptation to use with bash. dropbox-update-dotfiles () { src="$HOME/Dropbox/dotfiles" dst="$HOME" if [[ ! -d "$src" ]]; then print "Directory $src not found." fi for f in "$src"/*~*(.swp|~|.pyc)(D); do if [[ -h "$dst/${f:t}" ]]; then # exists as symlink elif [[ -e "$dst/${f:t}" ]]; then print "WARNING: ${f:t} exists, but is not a symlink." else ln -sv "$f" "$dst" fi done }
- tednaleid 15y agoI use zsh too, but did something similar that should also work in bash: http://naleid.com/blog/2011/10/03/using-dropbox-to-share-your-home-directory-across-multiple-computers/ http://naleid.com/blog/2011/10/03/using-dropbox-to-share-you... I link my dot files as well as Documents, Pictures, Music, and Desktop directories that are also normally controlled by OSX. Having those shared across multiple computers is awesome. Sit down at a computer, and it's there. I also have my zsh files checked in to bitbucket (https://bitbucket.org/tednaleid/shared-zshrc/ https://bitbucket.org/tednaleid/shared-zshrc/) so even if the computer doesn't have dropbox (like many of the linux servers I have access to), as long as it has mercurial, I can clone the repo and be ready to go.
- marshray 15y agoI've had that concern as well but have not found it to be a problem in practice. For one thing, it's not hard to go back to default vim if you're on a different system. For another, it's usually not that hard to copy your .vimrc over if you're going to stay awhile.
- Dobbs 15y agoOn foreign machines I'm rarely doing anything complicated enough where not having my .vimrc is noticeable. If I'm going to be spending a lot of time working on something, then it isn't a problem to either use my local machine or sshfs the remote server and work on it from my local editor. I try and keep my .vimrc limited to configuration and enhancement and not change how the core works. Things like rebinding builtin actions will never be seen in my .vimrc.
- qdog 15y agoecho set ts=3 > ~/.vimrc echo "Toggle search highlighting on and off with F5 >> ~/.vimrc echo map "<F5> : set hls\!<bar>set hsl?<CR>" >> ~/.vimrc Everything else is gravy for me. While an extended rc is handy and I often store one where I can get to it, if I'm just editing a couple of files, vanilla + the tab size I want and a shortcut to highlighting search terms gets me going. YMMV I tried to get into emacs, but I kept coming back to vim. Probably because the first editor I really used was a version of 'ed' back when I played MUDs.
- sce 15y agoEnter is actually a good candidate for something like that: " turn off highlighted results (set nohlsearch) when pressing enter. " just pressing n or N will turn the highlight back again nnoremap <cr> :noh <cr> https://github.com/sce/dotfiles https://github.com/sce/dotfiles
- mun2mun 15y agoEven in new computer without net connection vanilla vim is good enough for editing. When sit in an alien computer with vanilla vim. At first I put these lines in .vimrc set nocp set hidden set ts=2 set sw=2 set autoindent set incsearch filetype on filetype plugin on map <C-J> <C-W>j map <C-K> <C-W>k map <C-l> <C-W>l map <C-h> <C-W>h For buffer management, combination of :ls, :b and :b# does the job well enough, compiling command-t plugin isn't necessary :). For listing of files there is :sexplore . For code browsing there is plain old ctags. There you go, almost 90% of environment created. Other things like surround or snipets support would be better. But I don't use them most of the time :).
- dextorious 15y agoReally? You are doomed because you don't have some extra configuration niceties? Basic vim editing is not enough? Then I have to ask: what exactly are you doing in that other computer? If it's just some temporary sysadmin stuff and the like, then you surely can get by with the basic vim functionality. Now, If you're gonna be using that other computer for a longer period, then why not just add your .vimrc there? With github, bitbucket, dropbox et al you can have your configuration pushed to the other computer in seconds. I also find that with everybody having laptops these days, the need to use some "other computer" is much less frequent.