swift-sh
diffconflicts
swift-sh | diffconflicts | |
---|---|---|
4 | 16 | |
1,772 | 380 | |
- | - | |
2.9 | 2.4 | |
3 months ago | 4 months ago | |
Swift | Vim Script | |
The Unlicense | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
swift-sh
- Ask HN: Share a shell script you like
-
Using Swift for Scripting
Yes, swift CLI will compile and run your swift file.
But many people also want to use libraries. For Python, they use the system libraries or work within an environment with installed libraries (i.e., the library-install process happens at environment-configuration time).
In Swift, the easiest way to consume libraries is using packages, but that requires a Package.swift declaring the project scope for the script file (which must comply with top-level and main-entrypoint code requirements).
The easiest way to do that when scripting is a swift tool that manages the process of gathering your library dependencies, auto-generating a project, building the tool, and caching it all so there's no overhead the next time.
The best available tool now is https://github.com/mxcl/swift-sh. It reads dependency information off import comments.
It can also generate the project for you, if/when you want to build in XCode (e.g., move into a more complex application, perhaps requiring sandbox declarations).
Working scripts are not always updated, so any script-build tool has to maintain backwards compatibility, but the swift package manager has changed a lot in recent versions. swift-sh seems to err on the side of backwards compatibility, and does not support e.g., the most recent dependency versioning styles.
Swift-forum discussions about better support for scripting haven't resulted in any official tooling.
- On Env Shebangs
-
Did anyone tried to run swift on raspberry pi before? I managed to install swift on my raspberry pi and print hello wold. Butbwhen i tried to do the same after 10 seconds it didnt work. Any idea why it didn’t print? DispatchQueue.main.asyncAfter(deadline: .now() + 10) { print(“Hello world”) }
Note that this has nothing to do with the Raspberry Pi. You'll have the same issue running on the command-line. If you wish to test your programs on your computer where you have more tools and horse-power, I find swift-sh gives a good command-line experience and is a great alternative to Playgrounds especially for small tests.
diffconflicts
-
Ask HN: Share a shell script you like
diffconflicts [dc] lets you resolve diffs as a two way diff between what's in the conflict markers instead of including the resolved parts in the diff. It opens the diff in vim but could be adapted for other editors. Verbose explanation: https://github.com/whiteinge/diffconflicts/blob/master/READM...
The author converted it to a vim plugin with the same name, but I use a different vim plugin implementation [mergetool].
[dc]: https://github.com/whiteinge/dotfiles/blob/master/bin/diffco...
-
Integrating Git and (Neo)Vim: LazyGit + Fugitive + MergeTool for maxiumum efficiency [Showcase]
I like vim-mergetool for merging in vim. It's inspired by the diffconflicts method (but written in vimscript): Diff the resolved conflicts instead of a three way diff with base. You can also switch to three way with :MergetoolToggleLayout LmR too, but I usually only switch to diffing resolved against theirs or ours.
-
Poll: how do you jump to Git conflict markers?
https://github.com/whiteinge/diffconflicts as a merge tool
-
What is the coolest, unknown(-ish) plugin that you're using that other people could benefit from?
https://github.com/whiteinge/diffconflicts is not unknown, but I think deserves way more attention. It transforms the way you resolve merge conflicts unlike any other tool I've seen.
-
Your git setup for neovim?
For resolving conflicts, I like https://github.com/whiteinge/diffconflicts. It's really good at cutting the noise from conflict markers and only showing what matters.
- Here's a question
-
Vim Regex
For resolving conflicts I recommend https://github.com/whiteinge/diffconflicts, the demo video explains it best https://www.youtube.com/watch?v=Pxgl3Wtf78Y.
-
What have you changed in your VIM workflow recently?
have you tried diffconflicts? started using it ages ago, might be worth checking out if you get tired of editing by hand.
- Which tools do you use for Git Conflicts?
-
Is there a better way to see git diff in vim?
I end up using https://github.com/whiteinge/diffconflicts it does the job I have looked for, I have adjusted the way it a bit to look more like 3 splits solver rather with 2 splits.
What are some alternatives?
resholve - a shell resolver? :) (find and resolve shell script dependencies)
lazygit.nvim - Plugin for calling lazygit from within neovim.
stderred - stderr in red
vim-mergetool - :cake: Efficient way of using Vim as a Git mergetool
dotfiles
conflict-marker.vim - Weapon to fight against conflicts in Vim.
spellbook - 🪄 Shell and Powershell scripts registry
vim-diff-enhanced - Better Diff options for Vim
Alamofire - Elegant HTTP Networking in Swift
diff-therapy.nvim - resolve those conflicts and have a happy relationship with git
SwiftBar - Powerful macOS menu bar customization tool
neovim - Vim-fork focused on extensibility and usability