15 ms·
That may be, but it's tough to use a customized vim on your local machine, and then switch to a stock install on a server somewhere, no?
by allengeorge 10y ago
That may be, but it's tough to use a customized vim on your local machine, and then switch to a stock install on a server somewhere, no?
- exDM69 10y agoCopy over one file (.vimrc) and you're done. If you use plugins, then copy them over with git or whatever. And my setup is very conservative so it's mild annoyance at worst. The defaults are just bad, I recommend using vim-sensible or doing your own lean and mean vim config.
- test1235 10y agoAs someone who only uses Vim casually, what's an example of a bad default? For someone who is new to Vim, they wouldn't know if the controls are bad, or tough to learn e.g. using jkl; instead of arrow keys.
- JoshTriplett 10y ago> As someone who only uses Vim casually, what's an example of a bad default? By default, vim doesn't enable filetype detection or syntax highlighting, so even though it can easily recognize a source file's language, it doesn't.
- t4nkd 10y agoAnecdotally, this is exactly the sort of thing I have never needed while using vim on a server. Just let me modify content in the word hole...
- JoshTriplett 10y agovim isn't the "on a server" editor for me, it's the "everything" editor. I like that it works the same way everywhere, but I primarily use it to edit files that do have recognized filetypes. (As an aside, for me the main value of syntax highlighting isn't the normal case, but rather the case where the syntax highlighting emphasizes a problem, such as an unterminated string or other typo.)
- Annatar 10y agoI like that it works the same way everywhere, but I primarily use it to edit files that do have recognized filetypes. UNIX doesn't care about filetypes, since the paradigm is working with binary streams of data, and it's implemented in a way that users don't need or have to care either. File types are a concept from MS-DOS, popularized by Windows, and a major hindrance to a UNIX user's workflow.
- flukus 10y agoSo if we look through the source tree of a random unix I won't find any .h or .c files?
- Annatar 10y agoYou are likely to find .c and .h files, but for UNIX, that is also just another stream of bytes - it cares not that the stream of bytes happens to be in the ASCII, 7-bit range. Where are you going with that?
- flukus 10y agoThe point is .c and .h are recognized file types and Unix has them.
- Annatar 10y agoUNIX doesn't treat them in any special way. There is no such thing as file types on UNIX. That concept does not exist, nor is it needed on UNIX. If one wants to classify a file at-all-costs, we have the file(1) command on UNIX, and that command consults /etc/magic (see magic(4)); if magic(4) does not contain the required byte stream excerpt, the output of the file(1) command will be an untrustworthy approximation at best. And still, the file(1) command is strictly for humans who feel the need to classify-at-all-costs, not for the operating system.
- 10y ago
- chongli 10y agoI must be weird or something but I've gone back and forth between vim and emacs for years before finally settling on just vi (Keith Bostic's nvi, to be exact). I've spent countless hours reading about and installing plugins on both of those big editors instead of just getting work done. Now that I just use vi, I realize how little of that stuff I need and how much I can get done with just macros and ! (the shell out command).
- JoshTriplett 10y agoI've encountered several quite painful behaviors of traditional vi that vim fixes. For instance, with traditional vi, if you start out changing a region, you can't move or change text outside that region without exiting insert mode.
- chongli 10y agoI actually like that feature. I try to stay out of insert mode as much as possible. This feature lets me mash C-w or even C-u without worrying about changing text outside the original scope of my edit. I use the c command to change text inside of an html tag (for example) and I like that this protects me from damaging the tag itself.
- Annatar 10y agoThat's the way vi is supposed to work, since it is based on the paradigm of a modal editor. I learned vi in vi on UNIX, so the modal way stuck and I can glide and float between vi on UNIX and vim on Linux without getting busted on trying to move with cursor keys. I see Windows/Linux users get busted on that a lot, because they didn't install UNIX at home and learned on that first. It's frustrating to watch them get busted by that in person, over and over again.
- Annatar 10y agoThat's the way vi is supposed to work, since it is based on the paradigm of a modal editor. I learned vi in vi on UNIX, so the modal way stuck and I can glide and float between vi on UNIX and vim on Linux without getting busted on trying to move with cursor keys. I see Windows/Linux users get busted on that a lot, because they didn't install UNIX at home and learned on that first. It's frustrating to watch them get busted by that in person, over and over again.
- Annatar 10y agoUpvoted! Same here; I hate it when syntax highlighting makes it difficult for me to see the code, when I'm on a server and am just trying to get some work done. I cannot comprehend why I would want to see code in all those colors, with horrible contrasts, hard to read? Why? I know the syntax of the code, don't need or want anyone shoving what they think I need or want down my proverbial throat!
- cma 10y agoIt can be pretty useful when editing a bash file and the color highlighting shows you a missed close-quote, etc. Same for config files.
- kzrdude 10y agoVim used to have very very conservative defaults, but it was fixed in Vim 8. Some very useful features like persistent undo are still not enabled by default.
- toothbrush 10y agoBear in mind that that feature is disabled for good reason, it has some serious security implications (e.g., your visited file history is potentially leaked, as well as sensitive text ending up in your .vim folder).
- kzrdude 10y agoSecurity concerns in the same editor that added non-authenticated blowfish encryption in 2010?
- masukomi 10y agohjkl (not jkl;) are a) ergonomically bad because they are one key off of home row position and b) completely useless for anyone who types with a different keyboard such as Dvorak, and presumably some foreign language ones. also, HJKL actually IS the arrow keys... but it's the arrow keys from an ancient computer that no longer exists. People get all uppity about it being the "right" way but there's no logical argument that supports hjkl on a modern computer OTHER than the fact that it's the default.
- exDM69 10y agoI disagree with this. The j key is the most used out of hjkl, and it's under your right index finger. I do most horizontal movement with left hand (primarily w and b) anyway.
- vadskye 10y agoCompletely agree. Personally, I'm trying to spread the One True Way of ijkl navigation, but it's slow going...
- chainsaw10 10y agoI'm curious: what do you use to enter insert mode then?
- hueving 10y agoInsert mode is for noobs. ;)
- appleiigs 10y agoJust recently I've been starting to rely on 'a' and 'A'. Maybe I could switch to ijkl
- heartbreak 10y agoIn default vim, i inserts to the left of the cursor. In ijkl, you simply map h to insert left of the cursor. It's even on the left of your new arrow keys so the mental map works better too! I'm a huge ijkl fan, because I learned wasd long before I learned vim.
- Symmetry 10y agoFor instance one of the first things to do is set incsearch for incrimental search as you type out search terms, the way every modern web browser, IDE, and emacs work. Also I think using 'set hidden' should be a good default for pretty much everyone.
- deathanatos 10y agoIt doesn't automatically `:set et sw=4 ts=4` in Python. When editing on a server, this can be downright annoying at best and deadly at worse, if you accidentally get a tab in the resulting out. (We've started deploying something like vim-sensible, though I didn't know about vim-sensible, so I might start deploying that.)
- wyclif 10y agoOr just clone your dotfiles from a repository.
- yodsanklai 10y agoI agree. Personally, I prefer getting used to the defaults than going through the pain of customization. I tried it, but it meant additional syncing between my machines, fighting with plugins, and it's not always possible to customize vi mode in some environments (like Eclipse or Sublime). Overall, I think vim is great for simple and fast editing, but as soon as I need to work on a multiple files projects, I switch to something else, possibly using vi mode if there's one (and even there, I wonder if I shouldn't embrace mac os shortcuts once for all).
- dimal 10y agoDevelopers spend 99.9% of their time working in their local environment, so this isn't very important for them. If you're a sysadmin, then it makes sense, but then you're probably already proficient enough with vim or some other editor that works on your server.
- AceStar 10y agoI don't think it's very hard to switch to stock vim, when the keybindings remain the same. Most of the customisations commonly used are either cosmetic (syntax highlighting, brace matching, search-as-you-type, etc) or don't require much adjustment (delete through all text, etc).