16 ms·
Amp – A complete text editor for the terminal
- RemarkableMan 8y agoWill this Rust spam never cease?
- ecthiender 8y agoThe documentation or the website doesn't list all the languages it supports, especially for jump to definition. It just says all popular languages. This is a bit concerning, because the docs also mentions no (planned) support for plug-ins yet. FWIW, I'm interested in Haskell support. For jumping to definitions and showing type of expression under cursor.
- Karliss 8y agoFirst page under symbol jump states that it is based on and can be extended using .sublime-syntax format. At this point of time I was expecting language server protocol support.
- wasted_intel 8y agoLSP support is planned! Although, the rationale for including it is for advanced language features, like "go to method". I'd be surprised if other editors were using it for syntax highlighting. I've had to jump through hoops to keep that performant on large files. Seems like putting that in a separate process would make performance even more of a challenge. I found this after a quick search: https://github.com/Microsoft/language-server-protocol/issues/33#issuecomment-231883169 https://github.com/Microsoft/language-server-protocol/issues...
- anonimito 8y agoghcmod-vim lets you query types but I hadn't found anything that allows gotodef which is why I just went back to vscode + vim keybinds + haskero and everything just works.
- mariusmg 8y agoMicro is nice too https://github.com/zyedidia/micro https://github.com/zyedidia/micro (been using it daily for a few months now).
- mixmastamyk 8y agoLove it though dev has slowed.
- GordonS 8y agoI recently discovered this too. I'd been using nano as my default terminal text editor for years, but micro is a nice upgrade - I especially like the undo feature, the syntax highlighting, and the mouse support.
- mario0b1 8y ago>A modal, keyboard-driven interface inspired by Vim that makes navigating and editing text fast. But what does it do different than vim? Having competition is good, but I don't see any "that's why you should use amp and not vim"-reason. Where is it?
- cbkeller 8y agoSounds like navigation might be different, but the linked page is a bit cryptic: > Fast, precise cursor movement without repetitive keystrokes or fancy expressions. Look where you'd like to move, and type the token. That's it. Digging a bit more, I found this [1] (in addition to the normal h,j,k,l, etc.): > Jump Mode > Press f to switch to jump mode. Elements on-screen will be prefixed with a two character jump token. Type the characters to jump to the associated element. > For files with syntax support, you can jump to class, method, and function definitions using symbol mode. Hit Enter in normal mode to use the symbol finder, which works identically to open mode [1] https://github.com/jmacdonald/amp/blob/master/documentation/pages/usage.md https://github.com/jmacdonald/amp/blob/master/documentation/...
- nerdponx 8y agoThis is similar to the vim-sneak plugin for Vim: https://github.com/justinmk/vim-sneak https://github.com/justinmk/vim-sneak It's very useful.
- deleted 8y ago[deleted]
- tom_mellior 8y agoLooks similar to the Emacs Ace Jump mode too: https://www.emacswiki.org/emacs/AceJump https://www.emacswiki.org/emacs/AceJump
- Cyphase 8y agoI think one of the main reasons it exists is that it's written in Rust. One clue is that the TLD is .rs, plus there's been a lot of "a <type-of-program> written in Rust" lately. Which is fine; it's just an observation. I myself am going to be getting into Rust soon, hopefully.
- josteink 8y agoMaybe choose another name? I mean: Good luck trying to out-SEO Google re-using their own term[1] :) [1] https://www.ampproject.org/ https://www.ampproject.org/
- albertgoeswoof 8y agoIf it’s anything like emacs or vim it will surely outlive Amp and hopefully Google as well
- ilikehurdles 8y agoYou say that as if it’s a challenge to outlive something Google puts out.
- littlestymaar 8y agoYour comment matches surprisingly well with this other post[1] on top of HN right now. Which is funny because your comment is 4 hours older than this submission :). [1] https://news.ycombinator.com/item?id=18509735 https://news.ycombinator.com/item?id=18509735
- lazerwalker 8y ago"If it's anything like emacs or vim" is a very ambitious goal.
- wasted_intel 8y agoI actually came up with the name before Google announced that project, so I'm going to be stubborn and stick with it. :)
- em-bee 8y agothe thing that came to mind for me when i saw the name is winamp. that's quite a bit older...
- apas 8y agoInstalled it and played around for a bit. Nice work overall. Amp's jump mode (press `f` and elements in the buffer will be prefixed with a two character jump token) is pretty cool. Would love to see this in Vim.
- mbudde 8y agoThis plugin is working quite well for me: https://github.com/justinmk/vim-sneak https://github.com/justinmk/vim-sneak
- _ikke_ 8y agoThe [EasyMotion][0] plugin provides this. It has several modes to select where you want to jump to. [0]:https://vimawesome.com/plugin/easymotion https://vimawesome.com/plugin/easymotion
- michaelmrose 8y agoThe irony. Easymotion was created as a better precisejump. Precisejump was created or at least uploaded in Feb 2011.
- nickspacek 8y agoIt's funny isn't it. I guess I don't try hard enough to find productivity-enhancing Vim plugins. I've tried various "Vim enhancement suites" intended to bring a number of useful plugins and had some success, but since I can't rely on them on new servers I find myself more often than not just using plain Vim. Some other commenters in the thread have raised the point that having more supported functionality out of the box is a good selling feature. To me it seems that having it built it can (possibly) benefit from a more intentional effort to make it cohesive, whereas with many disparate plugins you have to encourage, force, or otherwise guide developers to build something that fits and behaves with the rest of the platform.
- wasted_intel 8y agoYou've touched on an important point: taking inspiration from workflows and incorporating them into the core editor itself. For editing text, there's already a lot of flexibility in Amp's keymap system[0]. As users compose more sophisticated/useful macros, we can promote them to the default keymap, and if they're really useful, we can build them as discrete commands in Amp itself. That way, the core editor evolves to encourage a particular workflow. It's opinionated, and it may not appeal to everyone, but that's kind of the point. [0] https://amp.rs/docs/configuration/#multiple-commands https://amp.rs/docs/configuration/#multiple-commands
- justanegg 8y agoonce you learn something in vim you won't forget it, but there's always something else to learn. vim-likes need to show contextual tips somewhere or at least an F1 (if that's even unix-y) and a really obvious way to know which mode you're in too.
- Jyaif 8y agoThey should take advantage of wasm and offer a web version.
- throwrhebrick 8y agoI honestly don't know why people would want to navigate code using jump-mode/easymotion. I've found it far more confusing than just searching for the word.
- vectorEQ 8y agoctrl+W <word> enter - seems you are right :D <3 nano hahah i find more complicated editors just distract with their fancies from what you are doing. inputting and deleting characters.
- laumars 8y agoIt's just a learning curve. Over time it starts becoming second nature and you don't even notice that you're doing it. Must like most things we do in our day to day that are actually rather complication functions (driving, writing, walking, etc). What I do like about the vim keys though is the ability to delete or copy/paste with precision by chaining hotkeys together. Regarding your searching for a word example, unsurprisingly you can do the same in vi (let alone vim) too: / - search forwards ? - search backwards edit: It wasn't me who voted you down by the way. I know you've not complained about it but I wanted to express that I don't agree with you getting downvoted even though I don't agree with the content of your post.
- ivanfon 8y agoI’ve actually found the opposite - sure there’s a learning curve, but once you get used to it and it becomes second nature, Vim becomes the fastest way to convert thought to code.
- otikik 8y agoI have been using Vim for several years now and I still struggle with basic-level movement commands. Like, I never remember if f-h will move me to |hello or to h|ello. If those are working for you, that is great, but I appreciate some alternatives there. The usual Vim approaches ("do vimtutor!" or "practice one new command a week!") are not working for me.
- lproven 8y agoIs it CUA? If so, I'm interested. Reads page > modal [...] > inspired by Vim Closes tab
- easytiger 8y ago> Amp is inspired by Vim's modal approach to text editing And I closed the page. Modal editing simply makes zero sense on a modern keyboard. It is awful.
- proaralyst 8y agoHave you used it extensively? Why on modern keyboards? I can't stand non-modal editors now. I find them extremely limiting.
- otron 8y agoIn what way is modal editing awful? Modal editors are the only solution I've come across to what I see as the problem with modern keyboards and editors: the inability to do everything you want to do without moving your hands away from the home row. Intellij, eclipse, sublime text, every "modern" non-modal editor I've used expects me to move my hands to the arrow keys if I want to move the caret. This is a personal gripe for me as repeatedly moving my hand back and forth between the home row, the mouse and arrow keys triggers my RSI. At least a non-modified bash prompt lets me navigate using some archaic control key combinations (^a: beginning of line, ^e: end of line, ^f: forward one character, etc.)
- vthriller 8y ago> At least a non-modified bash prompt lets me navigate using some archaic control key combinations You can get vi-like navigation in bash with a simple `set -o vi`
- craftyguy 8y agoCare to explain why you think modal editing is awful on 'modern'[0] keyboards? 0. besides adding backlights, changing build quality, and perhaps other layout options like dvorak or colemak, keyboards have not really changed in decades...
- theonemind 8y agoI agree about modal editing. Humans don't generally deal well with inconsistencies. I can type on Dvorak and QWERTY, at decent speed on both, but mostly type on Dvorak. Typing QWERTY gives me a bit of mental fatigue from continuously overriding my Dvorak-typing circuitry. I can feel a less extreme version of that mental fatigue from using modal editors. Just a growing irritation as I hit keys in the wrong mode, which happens at a fairly constant rate throughout the editing session. I used vim for several years, and honestly, I never found anything faster for editing (though, not so much for writing, but very efficient at throwing around and manipulating anything you don't already have done.) I don't use it for the same reason that I take the slightly-longer-but-much-less-congested route to work. The annoyance of stop-and-go traffic costs me more mentally than those extra minutes.
- CraneWorm 8y agoI think I'm too into vim to like this now. I miss more "advanced" gestures, like: daw, caw... Not being able to edit a word without positioning caret at the beginning feels limiting.
- wasted_intel 8y agoI know this defeats the purpose of minimal configuration, but you can define those kinds of actions fairly easily by defining keymaps that compose multiple commands[0]. For what you're after, you could do this: keymap: normal: W: - "cursor::move_to_start_of_previous_token" - "buffer::change_token" You can view the default keymap right in Amp, too, as well as a list of all of the commands. Happy to entertain a PR that sets that as a default keymap going forward. :) [0] https://amp.rs/docs/configuration/#multiple-commands https://amp.rs/docs/configuration/#multiple-commands
- CraneWorm 8y agoThanks, I'll try it out. Maybe I'll drop you a PR if I have time :).
- DC-3 8y agoThis looks interesting, but from either of the AUR or through Cargo directly the build fails because of a Python StopIteration error in the termbox crate.
- wasted_intel 8y agoThis is an unfortunate consequence of depending on termbox, which uses Python as part of its build (waf), which unfortunately doesn't work in Python 3.7. On Arch, you need to alias python to python2 for the build to work. I'll comment on the AUR package. As an aside, my current 0.6.0 feature is moving completely towards termion (a Rust-based, lower-level terminal lib) that'll resolve that!
- wasted_intel 8y agoAUR package is fixed; feel free to give it another shot. :)
- throwaway487548 8y agoThe classic ed and its visual version which is called vi are really good-enough if done right. The central concept here is simple regexps bound to one key commands, and that these commands compose. This is the reason why vi is what it is. https://karma-engineering.com/lab/wiki/Tools/Neovim https://karma-engineering.com/lab/wiki/Tools/Neovim The only problem is that all classic vis, including vim, have been coded by amateurs and the code is a terrible mess. nvi was good, as far as I remember.
- the_clarence 8y agoWat
- carlmr 8y agoIt says you only plan UTF8 support and no Windows line endings. The windows line endings ok, and I get why in Rust it was easier with UTF8 (although there are some good crates for handling encoding). However this seems awfully restrictive to me.
- the_clarence 8y agoIt’s a start
- carlmr 8y agoIf it's a start it should still be planned though.
- wasted_intel 8y agoI've mostly built Amp to fit into my workflow, which is unix line-endings & ASCII/UTF-8 at the moment. Not opposed to alternative encodings, but I think that's a non-trivial addition. Amp uses a gap buffer under the hood and avoiding segmenting multi-byte UTF-8 graphemes/grapheme clusters was tricky. It's definitely possible, it just hasn't been a priority, yet.
- jimsmart 8y agoArguably this is somewhat of a kludge(?), but one option (which would involve less coding than making the engine work with different encodings) would be to use readers/writers to support other formats, and keep using UTF-8 internally. UTF-16BE/LE and UTF-32, plus Windows CPs, are all really easy to do like this — probably others too. (Note that depending on the range of codepoints used in files using these encodings, they may take more memory in UTF-8 form. This usually isn't an issue unless one is handling large files of Kanji)
- carlmr 8y agoI agree, especially as UTF-8 is standard inside Rust. Also the encoding library would make it easy enough to support other formats. I'm not sure if the editor streams or loads into RAM right now. If it already loads into RAM this is a tiny change. https://crates.io/crates/encoding https://crates.io/crates/encoding Line endings should also be unproblematic.
- speg 8y agoJump mode isn't working for me. It highlights all the two letter codes but keeps taking me to the same place (not the code I type). So I tried a new file and then the error message wiped out my sample text. Also, I don't see how to switch between buffers?
- wasted_intel 8y agoHmm, the jump mode issue is strange; can you please file an issue as a starting point? As for the error message, it didn't wipe out your file; it opened a new buffer with the error message. You can switch between buffers using Tab. There's a full keymap listing available through a command called "application::display_default_keymap" that you can invoke by hitting 0 in normal mode and searching for it.
- the_clarence 8y agoI’m on my phone so I haven’t checked. But my biggest grip with vim/emacs is discovery of new commands (for noobs or experts). What are you doing to solve that? Sublime Text fixes this by allowing you to do fuzzy search to access all the commands (command-P). Once you find your command it also displays the keyboard shortcut next to it so that next time you can use it instead.
- wasted_intel 8y agoYou can fuzzy search Amp's commands, or display a buffer with a complete listing of all of them[0]. You can also view the default keymap[1] right in the editor. Hope that helps! [0] https://amp.rs/docs/usage/#running-commands https://amp.rs/docs/usage/#running-commands [1] https://amp.rs/docs/configuration/#key-bindings https://amp.rs/docs/configuration/#key-bindings
- the_clarence 8y agoAs you note in there, it isn’t really made for discovery. It’d be great if you could see the key binding next to the name of a command when you press ‘0’. Other feedback: fuzzy search doesn’t work well for me. For exemple if I don’t write the folder name I can’t see the file. If I press backspace it deeted the entire search. It’s be great to have “press ?” Or something like that when you open the editor. Like that you know directy how to see the key bindings.
- craftyguy 8y agoUnfortunately this project is unbuildable on a system with Python 3.7, because it builds termbox, which has an old version of waf that does not support Python 3.7.. https://github.com/nsf/termbox/issues/117 https://github.com/nsf/termbox/issues/117 Edit: Looks like the amp developer is taking steps to remedy this, great! https://github.com/jmacdonald/amp/issues/113 https://github.com/jmacdonald/amp/issues/113
- pkulak 8y agoThat navigation method is genius. Can't wait to try this out.