Regular vim has tabs and you can bind any key you want to switching them (I use F2/F3). The default is :next and :prev or gt/gT. I’ve been using the feature for years now. You can also open a list of files in separate tabs with the -p argument. So “vim -p CppFile.*” will open the .h and .cpp in separate tabs for example. You can then Y/p between the two buffers. It’s so useful that I always “alias vi=vim -p” in my .p…
Is the '-p' necessary? I like to open files in windows with e.g. "vim -O file1 file2", and I've noticed that if I accidentally omit the '-o' or '-O', it opens each file in a tab. Or at least, it opens each file in individual pages that you navigate between with ':next' / ':prev'.
Linux Terminal Goods
51–60 of 65 posts
Re: Linux Terminal Goods
#52i really wish spacemacs didn't have that pretty lame loading screen, as a spacevim devotee i found alot of things that spacemacs does that specifically address some issues i have with spacevim. i know the correct path forward here is, of course, diving into the guts of spacevim and tinkering until it works for me, but i will post one quirk as it will probably be some time before i will be able to write my own compreh…
Re: Linux Terminal Goods
#53Re: Linux Terminal Goods
#54I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash. I understand bash is the basis of so many things, that its importance is just enormous. But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) bu…
If you want to do that on a remote machine you just add this to the end of the command -ComputerName remotecomputer: Get-WmiObject Win32_LogicalDisk -ComputerName remotecomputer
And then you can just use the returned object to iterate over it: $disk = Get-WmiObject Win32_LogicalDisk -ComputerName remotecomputer -Filter "DeviceID='C:'" | Foreach-Object {$_.Size,$_.FreeSpace}
Re: Linux Terminal Goods
#55I spend loads of time in a shell. One day I'll push my full dotfiles publicly, but until then here's a few snippets I've found super handy. I'd advise against using them verbatim but there's a few things in there that took some time to figure out. Beware they can be somewhat buggy / break things though. Highlights include: - Bind C-c/C-v to Copy/Paste, bind C-g to sigterm (Note: Breaks docker interactive unless you m…
Production root is made even more visually offensive.
Re: Linux Terminal Goods
#56Earlier quoted context omitted.
Hey guys, I have the same thing, but I called the command ".." (no it doesn't conflict with the directory). ".." by itself is the same as ".. 3" .. () { local arg=${1:-1}; while [ $arg -gt 0 ]; do builtin cd .. &> /dev/null; arg=$(($arg - 1)); done; }
Mine is similar, but only does one cd command - to allow better use of `cd -` up() { local ups="." for((i=0;i
Re: Linux Terminal Goods
#57some vim enthousiast here scalded me for sending him spacevim linkand told me to use neovim. i don't use vim so i wouldn't know, and vim people seem easily offended :D. anyhow, just thought i'd not his input.
Re: Linux Terminal Goods
#58Earlier quoted context omitted.
Hey guys, I have the same thing, but I called the command ".." (no it doesn't conflict with the directory). ".." by itself is the same as ".. 3" .. () { local arg=${1:-1}; while [ $arg -gt 0 ]; do builtin cd .. &> /dev/null; arg=$(($arg - 1)); done; }
Mine is similar, but only does one cd command - to allow better use of `cd -` up() { local ups="." for((i=0;i
Though yours looks much nicer ^^"
Re: Linux Terminal Goods
#59Earlier quoted context omitted.
Its simplicity is an important part of the offering. Bash is perfect when you need predictable executions. When you use Bash, you benefit from an entire ecosystem that also uses it. That same ecosystem is not motivated to drastically change the shell, and therefore it remains stable and predictable. Bash typically isn't like Python or JavaScript, where certain features are introduced at a particular version and you h…
I don't disagree with your points but I think your following comment is a little misleading: > Bash typically isn't like Python or JavaScript, where certain features are introduced at a particular version and you have to constantly check for them, or not use them outright, or maintain which binary you have installed at all times. One Bash binary typically contains the same feature set as another binary. While you're…
You mention it as an aside, but I think it speaks to your point about external utilities. In that thread (I also think GP intended to comment on that topic), there was confusion to what "Pure" meant. The first sentence is, "The goal of this book is to document commonly-known and lesser-known methods of doing various tasks using only built-in bash features."
Re: Linux Terminal Goods
#60Earlier quoted context omitted.
You can also combine it with ripgrep. Much faster than git grep.
I actually time-tested git grep vs ripgrep, and I'm not seeing meaningful differences on my repos. ripgrep smokes regular grep but for some reason git grep is just as fast as ripgrep
I wrote more about this here: https://lobste.rs/s/0kaozs/don_t_underestimate_grep_based_co...