104 karma · joined April 19, 2023
I haven’t had time to try Nix yet, but HomeBrew does have a declarative-ish workflow that I’ve been using for years:
Brew Bundle [1] lets you have a plaintext file listing all packages you want installed on your system. Add a line for stuff you want installed, delete a line for stuff you want removed, invoke it the right way and it will install/remove packages until your system matches the list. The initial list can be generated by “brew bundle dump” or something like that.
For configuration, I find that a normal dotfile repo cloned into my ~/.config (with a script that maintains symlinks to config files in e.g. ~/Library) works well enough for my use.
Fortran has also added support for e.g. object-oriented programming, pure functions (no side effects for better optimization), and pointers. So idiomatic modern Fortran code looks very different from the “Fortran 77” code that many people might think of when they hear the name :).
But if your organization pays for Overleaf, you can sync Overleaf projects to local Git repos - and just pull / push as you would any other Git repo.
This is the best of both worlds IMO, since collaborators that don’t know Git can use the web editor without prior knowledge, while collaborators with strong opinions about editors usually know Git (or are willing to learn it).
There is also a Dropbox sync option, but I don’t recommend it. I’ve experienced bugs several times where TeX files suddenly become empty when using it.
In editors with configurable keyboard shortcuts, you can bind this to tab yourself. For example, in Vim, the normal-mode command `==` would correctly reindent the current line. (Here, `=` is an operator, so you can also apply it to other regions like `=i{` to reindent correctly everything inside braces.)
To bind tab to reindent correctly in normal and visual mode, you can put this in your vimrc:
nnoremap <tab> ==
vnoremap <tab> =
You can also remap it in insert mode if you want, but then you might want to throw some if-statements in there to determine when to indent and when to reindent :)Superconducting computing is a big one - even if we stick to classical computers (i.e. not quantum computers), there are estimates that superconducting computers could be ~1000x more energy efficient than state-of-the-art semiconductor computers.
Some reasons for me personally:
- It works well enough. I rarely have issues (maybe once a year as you say?), and then it’s usually resolved by a device reboot. Once I had to turn iCloud sync on and off again. However, I’ve learned to avoid e.g. working on Git repos in iCloud Drive, which tends to upset the sync process.
- It’s cheap. I can get 200GB storage shared with family for €3.5/month. For example Dropbox doesn’t sell less than 2TB plans, which with family sharing becomes €17/month. That’s 5x more.
- It is the best alternative on iOS. I tried lots of other sync apps before I migrated to iCloud. Partly, this is because Apple has crippled the competition by not allowing them to sync in the background without battery-draining hacks, not allowing them to integrate directly with the Photos app, etc. Partly it is because the other cloud providers I tried didn’t integrate properly with e.g. the Files API.
I often work with files (both documents and code) where Unicode input is permitted, and it can then be important to know what exactly is written in the file. Fancy ligatures make this ambiguous.
I would also advise against ligatures in terminals, as it can mess up some text-based interfaces.
Arguably, this is because the common definition of modular arithmetic is itself zero-based: “modulo N” maps all integers into the numbers [0,N-1]. It is fully possible to define a “%” operator that instead mapped the integers into the range [1,N], which might be more natural in 1-based languages?
> When flattening A (0..N-1 X 0..M-1) A[i][j] becomes flat[i + N * j].
To play the devil’s advocate a bit: Both cases above has the same number of “-1” offsets; the question is whether it is in the indexing or in the bounds. In the 0-indexed case, i goes from 0 to N-1 instead of from 1 to N, and this happens for every array dimension.
But Zsh is also POSIX sh compatible, is it not?
Where I live, we go even further: if you offer a subscription with a binding period, you also have to write the minimum total amount to be paid by the customer before they can cancel the subscription.
This helps prevent customers into getting tricked into spending more money than they can really afford, which is a good thing?
Then price the croissant at €1.25 instead? The US method would still make the customer pay that amount; the only difference is whether the math is done once by the seller or every 10min by a new customer.
This would kinda be the opposite of the idea in Helix/Kakoune: one automatically enters a visual-mode-like state after typing a verb that expects an object.
Curious. Unergonomic compared to what? Given your comment about separating commands and input language, I assume you’re using a non-modal editor, which usually rely more on modifiers than Vim.
Personally, I haven’t found any ergonomic non-modal editor, where I by “ergonomic” mean no RSI pain even after heavy usage. For me, the fact that editing in Vim is comfortable is its main selling point (more so than its speed).
> mistakes can lead to destructive consequences
I do often make mistakes, but I can’t remember the last time I accidentally did something so destructive in Vim that I couldn’t just undo it normally.
> Vertical scrollbar? Plugin
If you want scrollbars, the right solution is IMO to use a GUI Vim. I often use MacVim which is great, GVim is the obvious alternative on Linux/Windows, and NeoVim has lots of options (including, arguably, VSCode-NeoVim which is also great).
With MacVim, I can pop around randomly in a terminal and open Vim instances that run in the terminal as usual - and if I start editing something for long, I can type :gui to pop up an actual MacVim GUI window. I believe the same works in GVim.
> * Autocomplete code using lsp? Dance with plugins or copy paste literal screens of configs for nvim
I was annoyed by this as well. I then discovered that ALE (the venerable pre-LSP plugin for async linting) now has full LSP support, and it all “just works”. Doesn’t require NeoVim either. Just install the ALE plugin and put LSP servers in $PATH. ALE will find and use them. (By default, it uses standard Vim bindings like C-x C-o for completion, but you can change it.)
> * Want nice looking theme? Plugin! (Gruvbox in my case)
Vim 9.x (not NeoVim) has added a built-in Gruvbox theme named “retrobox” (both light and dark variants based on your background setting). If you don’t have it yet, you can get it as a plugin from here until your Vim updates: https://github.com/vim/colorschemes
> * Wrap long lines by whole words if possible? No default setting, I guess I need to search for plugin for that too.
There are built-in settings for this, but yeah it requires some initial fiddling to get it nice. (After that initial fiddling, I’ve been annoyed by how word wrap works in any other editor.)
It’s IMO easier to hit f again than to reach for the semicolon, and moreover this frees ; and , for usage in your own mappings (e.g. leader and localleader)
As someone that went the other way ~5 years ago, I’m curious what made you switch :). Are you btw on a hand-rolled config or one of the distributions?
(For me, it was that I was maintaining a ~400 line zsh config, and then learned that fish did most of the things I had configured “out of the box”. I considered switching back for increased POSIX compatibility since I often write bash scripts at work, but since Fish 3 added POSIX-compatible syntax for most pain points, I haven’t kept up with zsh.)
I think a lot of people don’t realize that modern Fortran actually supports object-oriented programming and Matlab-style array slicing, and comes with built-in support for e.g. matrices and complex numbers. It even has some features inspired by functional languages, like being able to mark functions as pure (side-effect free). Combined with its general speed, this makes it a pretty nice language for numerical code.
Although for most new users, I think Julia might be a better option than Fortran these days.
Which tmux pane management features do you miss in iTerm2?