8 ms·
I’ve spent my Easter break customizing Neovim
- raverbashing 4y ago> Try using hjkl instead of arrows. I don't see why some people insist in this BS The arrows keys exist for more than 30 yrs now, use them!!
- d12bb 4y agoWhy move my hands to the far-away arrow keys when I can just use hjkl (and all the other movement commands) right under my fingertips?
- betwixthewires 4y agoI don't know about you, but unless I'm actively typing, my hands aren't on the keyboard. And if I am typing, I'm in insert mode and the keys are useless then, but the arrow keys aren't.
- maccam94 4y agoIn vim specifically, there are many more powerful and precise movements you can make by chaining motions. But before those can feel natural and fast, you have to keep your hands on home row.
- raverbashing 4y agoThat is true. But I can aways move my hands back. (Searching and next, next will also take them out of the home row) Or I can use PgUp/PgDown as well.
- wruza 4y agoFeels natural to me when I 20<Up>. Homerow-ing is pretty distinct from vimops. I agree that it is faster than piano-typing, but it doesn’t add a huge sector into the pie chart of fast editing methods.
- lawn 4y agoAs someone who values ergonomics (using a 34-key split keyboard and all), I wish more people would see that it's more than just BS. Qwerty has existed for more than 30 years but it really sucks. Why cling to suboptimal things just because they're old?
- galoisscobi 4y agoI love using neovim but switch over to vscode for debugging. I’ve heard of vimspector and other plugins that are similar but I’m curious to hear what debug workflows do people here have with neovim/vim. Also, do you have any plugin recommendations for debugging?
- bitbang 4y agohttps://github.com/mfussenegger/nvim-dap https://github.com/mfussenegger/nvim-dap
- toolz 4y agoI honestly wish no one used development debuggers. If your data structures and programs are so complex you need to have deep inspection the root of that problem is your complexity, not your tooling. Every pleasurable project I've been on has been a project where print statements were the best debugging tool, because the simplicity meant I could more quickly debug something with a quick print than a slow deep dive into some debugger tooling. Granted, I get it, you didn't design the thing but you still need to debug it so no judgement, just more of an observation that if you limit yourself to simple tooling you might be surprised at how the pain points will force you to spend more time thinking about how to design your own code to be more simple and that's bound to have a far greater impact than any debugging tool could provide you.
- throwfdaew 4y agoI've found and fixed so many bugs that are simple to deal with using a debugger but would require hours of peppering the code with print statements to even get close to a solution. Some simple examples are deadlock bugs in multithreaded programs (easy to halt the program and see what thread is blocked on what) or uncaught exceptions from somewhere unexpected (set the debugger to break on throw). With a debugger you can also change the behavior of a live program, e.g. modify variables or jump over a piece of code that would otherwise be executed. Every person I've encountered professionally who either "doesn't use debuggers" or thinks "print statements are better" seems to be under the mistaken impression that all a debugger is good for is stepping through code. Debuggers are fantastic tools. You should re-evaluate your view of debuggers and you will become a better programmer.
- aidenn0 4y agoI used to say that emacs was better than vim at everything except editing text files, but with undo-tree and evil-mode I have less and less of a reason to reach for vim.
- deleted 4y ago[deleted]
- dlisboa 4y agoThere's much to say about "wasting" your off time by learning your editor. I still remember this one time, 15 years ago, where I spend literally the whole night configuring my .vimrc, reading the :help pages for all of the configuring options, doing the tutorials, and just moving around and getting comfortable with it. At 8PM that night I didn't know Vim, but by 6AM the next morning I was very productive in it. I'd say about 80% of my productiveness with Vim was achieved that night, and I could never change to a non-Vi editor since.
- mekster 4y agoIt's worth learning again what neovim offers with LSP and it's ecosystem. https://github.com/folke/trouble.nvim https://github.com/folke/trouble.nvim You'd appreciate nothing out of Typescript if your editor doesn't do LSP. AstroNvim gives you a good start.
- wruza 4y agoFeels like they all try to make vscode out of vim. Is there a truly vim-spirited LSP plugin? The one that doesn’t flicker on its own when you type, and only shows issues in quickfix after :make equivalent, even if it works asynchronously (works with Vim would also be great). I don’t mind configuring it for a week, but what’s on gif-shots usually repels me.
- d12bb 4y agoBasically all you need is nvim-lspconfig, which just attaches the language servers to your buffers (so you wouldn't even need that, but it saves a lot of boilerplate). From there you can use all you already know (this is from my Lua-based config, but you can do the same in Viml): vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = buf }) vim.keymap.set("n", "<leader>qf", vim.diagnostic.setqflist, { buffer = buf, desc = "Quickfix diagnostics" }) -- open Quickfix with LSP issues, Loclist possible too vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc") -- use LSP completion for omnifunc vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc") -- Ctrl+] for go to definition using LSP instead of ctags vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()") -- Code formatting (gq etc) using LSP Everything else one always sees with Neovim and LSP are other plugins like nvim-cmp or Telescope.
- davmar 4y agoi use neovim too and i prefer it over VSCode. the only major drawback is debugging and multi-file find/replace, so i do occasionally reach for VSCode. as the author mentioned, LunarVim is a great project worth checking out. i'm using it now and recommend it.
- bobbylarrybobby 4y agoHave you used the vscode neovim extension?
- virchau13 4y agoFor debugging, check out nvim-dap. It uses the same protocol as VSCode for debugging.
- memco 4y agoCan you use nvim-dap remotely? I am working on building up a neovim setup but the remote editing and debugging are the missing piece for me.
- KrishnaShripad 4y ago> multi-file find/replace For multi-file find/replace you should check out far.vim: https://github.com/brooth/far.vim https://github.com/brooth/far.vim > LunarVim is a great project worth checking out. i'm using it now and recommend it Haven't tried LunarVim but AstroNvim is great too.
- davmar 4y agooh this looks like what i need. thanks!
- scooble 4y ago> multi-file find/replace This is something I’ve found very easy in vim with bufdo , windo, or populating the quickfix list (or args list) and using cfdo/cdo or argdo to be really specific about where the replace should happen (e.g. replace FOO with BAR only on lines containing STRING or in files containing STRING).
- toolz 4y ago> Sounds great, but I don’t have time for this > Bullshit. Seriously, you probably have time to watch some junk content on YouTube or whatever I get it, we could all produce more and do more to some effort, but really, why? Is the purpose of mankind to completely dominate the universe and know everything? I'm sure the author means well, but this rubs me the wrong way. Plenty of people who just live ordinary, only very modestly "productive" lives are plenty happy and neither you nor I are better than them if we do more shit like customize our text editors. When someone says they don't have the time they mean they prioritize other things more highly than that thing and it feels wrong to tell them their priorities are wrong by accusing them of lying about their available time. I'm sure this comes off as overly sensitive and really I'm not that bothered by it, but I do think we as technical people can do better than I perceive us doing. Non-tech people seem to believe we're a very judgemental group and I can't say that I blame them.
- raverbashing 4y agoI agree. Watching videos on YT is part of some people's free time (like for other people is going for hikes, cooking, doing a hobby, etc), we shouldn't be condescending about that. It also begs the question, if I "have" to be learning about something productive, why Neovim? Why not Golang, Zim, the latest React plugin, etc People really need to calm down
- setr 4y agoI think it’s more charitable to read it as “it’s not a good enough answer” — you have the time, you’ve just chosen not to spend it here. Perhaps you have a good reason for it, and perhaps you don’t, but if you default to “who has the time for such things” you’re not being honest about it (to yourself, or to your questioner). It’s also only once you move on past that first nonsense answer that I can make my case: it’s worth spending your time on subject X, for reasons… But if we never get there, you’ve just brushed off the person unfairly.
- Kasmilus 4y agoHe did not say "Seriously, you probably have time to go for a junk hikes or cooking or whatever" - he talked about watching silly youtube videos which most people feel guilty about. I might choose to watch cute cats for 3 hours but I won't be proud of it. I don't think there's anything condescending about that, it's probably an advice the author found genuinely helpful in the past as well (well, I did).
- emacs28 4y agoI'm certain I've accumulated 100's - if not 1000's - of hours customizing my editor since I started learning it 6 years ago (sorry I'm an Emacs user not Neovim) and I don't regret 1 hour of it.
- nathias 4y agoif you don't have the time just download nvchad, it's pretty good out of the box
- ThatGeoGuy 4y agoI like this post, it reminds me a lot of when I started using vim / neovim in university. I spent a lot of time learning nano, cramping my hands, and then eventually deciding to sit down and learn vi proper. One thing I'm not so sure of though -- the justification for neovim seems to be partially due to needing a pretty recent version (at least newer than 0.5.0, for LSP features). There seems to be a big portion of vim users who seem to dump on neovim for one reason or another as some kind of meme, but I'm not sure that I agree about it being bloated or whatever. If I have to run Slack for work next to neovim / vim, I'm pretty sure I know what is using the majority of my system resources... Anyways, back to needing a recent version of neovim: I think the author could probably get by with just regular vim + extensions if they didn't use LSP stuff. To be honest, I still haven't really used LSP much, and most of my experience using similar features in other products (Intellisense in Visual Studio, whatever the equivalent broken thing in Xcode is called) is that it really was never that useful? Maybe I'm misunderstanding something and it's just not good for me and my workflow, but I feel like a lot of newer devs seem to enable it and declare that they can't work with anything that doesn't support it. For a long time I've avoided such features since they often seem to have poor performance (Xcode's version of such has definitely taken down a Macbook Pro on me before), or just generally don't add much to the experience other than some coloured lines under parts of my code. A good compiler (e.g. rustc) and corresponding linter for static analysis (e.g. cargo clippy) are actually pretty good on their own! This isn't true for every language out there, and maybe that's where LSPs are more useful - the Typescripts / Pythons / Javas of the world! I don't know if I'm over-simplifying it though. Either way, I'm pretty sure my point is that whether you choose vim or neovim, it's a great idea to sit down and spend a good chunk of time just getting better at using your tools. It's the kind of exponential improvement that won't even seem egregious a year down the line.
- chakkepolja 4y ago> To be honest, I still haven't really used LSP much, and most of my experience using similar features in other products (Intellisense in Visual Studio, whatever the equivalent broken thing in Xcode is called) is that it really was never that useful It's useful especially when you're switching many languages, or working with new libraries. Syntax error is immediately highlighted. Saves a context switch of changing to compiler tab and back to editor. With every symbol, you can view documentation by hovering. When autocompleting also, a small window/popup shows docs for currently selected symbol. You have automated refactoring available in-place, especially renaming. In most LSP it renames across all files and modules. Granted it's not that useful if you're in-and-out familiar with the stack you're working on. But once in a while you still need to switch languages and use new libraries it will be useful. I can't go back to pre-LSP world.
- jeffwiederkehr 4y agoI'm also a college student who went down the same rabbit hole recently. I found this github repo and video series super helpful for understanding how to create your own neovim config. https://github.com/LunarVim/Neovim-from-scratch https://github.com/LunarVim/Neovim-from-scratch https://www.youtube.com/watch?v=ctH-a-1eUME https://www.youtube.com/watch?v=ctH-a-1eUME One project that seems super cool I hope continues on is helix. https://helix-editor.com/ https://helix-editor.com/. I just started messing around with it but the selection -> action philosophy behind text manipulation feels much more intuitive to me even though I'm proficient with vim at this point.
- vlmutolo 4y agoI recently made the switch from vim to helix. It turns out that I don't really like screwing around with my vim config for hours and hours. Helix has great defaults (themes, LSP already installed, syntax highlighting already installed and enabled for popular languages) and that's made a huge difference for me. My vim config was at least a hundred lines, and that's not counting the endless plugins. My helix config is three or four lines to set my theme persistently and disable auto-filling parens. Something like: theme = "onedark" [editor] auto-pairs = false And Helix doesn't even support plugins (yet), so this is all bundled with the default install.
- christophilus 4y agoAre you running master, or the latest release? I had some odd bugs when I ran the latest release. Helix is surprisingly good for how young it is. I agree that movements in Kakoune and Helix are more intuitive.
- jeffwiederkehr 4y agoI'm on the latest release because their was a copr available for Fedora. I haven't noticed any issues so far but have only used it for a couple hours at this point.
- betwixthewires 4y ago
- qudat 4y agoI spent a few hours tonight going through https://neovimcraft.com https://neovimcraft.com looking for new nvim plugins. Every once in awhile I find something that's pretty useful. For example: - https://github.com/folke/trouble.nvim https://github.com/folke/trouble.nvim - https://github.com/lewis6991/gitsigns.nvim https://github.com/lewis6991/gitsigns.nvim I also have a tendency to review my current plugins to see if there are any I'm not using.
- infologics 4y ago[dead]
- dmitriid 4y agoEvery time I come across posts like this it's inevitably: - plain lies about IDEs, followed by - painstakingly recreating half-baked partly-working parts of what IDEs give you out of the box > I feel like moving your hand from the keyboard to the mouse every time you want to move the cursor a few words back or forth This interaction is literally built into your OS. It's called navigating with cursor keys and modifiers (Option on Mac, Ctrl on Windows, etc.) > to create a new file Even if there's no direct shortcut (such as Cmd+N/Ctrl+N), all menu items are available from keyboard. Moreover, you rarely create just a file. An IDE's "Create New" tools usually give you a plethora of choices to create a file and all the necessary boilerplate in one go > split the window or whatever This I can agree with, and I think I even reported this as a request for improvement to JetBrains. > Searching for some cool plugins and tweaking them was a very cheerful time and I run into almost no problems during the whole process. And, to be honest, 20 hours for creating a virtually full IDE from scratch customized entirely for your personal needs does not seem that much time at all. Lua is an easy and pretty language for configuration code, I think I’ve learnt it pretty well just by reading plugins’ code No mention of plugins or what they do. Random screenshot shows something a modern IDE has out of the box.
- ipiz0618 4y agoVim is great, and it's great to see the author spend time customising a tool that he spends most of his time using. But is vs code that bad at keyboard-only navigations? I spent much less time customising the settings and can do 99% of my tasks without reaching for a mouse. The remaining 1% are for some extensions like the Postgres explorer, which I could easily mitigate by switching to a terminal and run psql, but I don't feel like reaching for my mouse occasionally is a big waste of time
- gorjusborg 4y agoYes, vscode is not even close to as good at keeping the user's hands on the home row. The vscode neovim plugin gets you closer, but it can't seem to keep up with fast typing speeds in some modes. I like vscode for other features, but neovim is still superior for raw editing productivity in my book.
- deleted 4y ago[deleted]
- betwixthewires 4y agoI've taken the dive very recently as well, not into vim directly, but into a text editor called Helix. It's similar to vim, except the main difference is that you select what you want to modify and then modify it (word-verb I believe it is called in vim parlance). I think this makes more intuitive sense than doing it the other way around. I have a similar experience to the author. I did the tutor, wrote some notes as a cheat sheet, keep it open somewhere and just use the editor. I began using lots of tools that were keyboard focused and used vim-like keybinds (qutebrowser and other things). I wouldn't say productivity is increased, and I'm not a productivity zealot, but I'd say that once my mind adapts to the new environment, doing things is smooth as butter. The hard part is the fight inside yourself against the idea that you're relearning something you already can do another way that you don't actually need, afterwards you'll ask yourself why you ever did it the old way.