10 ms·
I kind of agree but vim's defaults are awful. Tim Pope has put together a good set of non-opinionated defaults which don't change key bindings or customize it o
by exDM69 10y ago
I kind of agree but vim's defaults are awful. Tim Pope has put together a good set of non-opinionated defaults which don't change key bindings or customize it otherwise [0]. I have a very similar vanilla setup with no plugins apart from syntax highlighting for some languages not included by default.
[0] https://github.com/tpope/vim-sensible https://github.com/tpope/vim-sensible
- allengeorge 10y agoThat 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?
- 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).
- justinmk 10y agoThat's why Neovim carefully implemented[1] most of the defaults (and a few others) from sensible.vim. [1] https://github.com/neovim/neovim/issues/2676 https://github.com/neovim/neovim/issues/2676
- Annatar 10y agoI kind of agree but vim's defaults are awful. I wonder whether that is because of vim compiled defaults or the way people who package vim think things should be, or both? I get so angry every time I log into my newly created Linux account and fire up vi, wanting to get some work done, only to find out that it's been aliased to vim, and there is that horrid syntax highlighting turned on. Unbelievably irritating, and frustrating to no end. Ironically, on AmigaOS where vim comes from, there are no customizations and no syntax highlighting - vim just works there as one would expect vi to work on UNIX.