brettanomyces / nvim-editcommand Goto Github PK
View Code? Open in Web Editor NEWEdit terminal command within current Neovim instance
Edit terminal command within current Neovim instance
If a user enters a interpreter from within the terminal. e.g. python
, then the prompt may change, $
-> >>>
. We should provide a mechanism to automatically update the prompt, and reset the prompt, when the user leaves the interpreter.
To do this we could remap <cr>
to run some commands if the current command is python/lua/ruby/etc.. and the same for whatever command is used to exit the interpreter. We will also need to handle the case where the user uses control characters, e.g. ^C
, to leave the interpreter.
a user may have used the c register for something, attempt to avoid wiping out user data
Unfortunately this issue lead to nothing:
neovim/neovim#8805
Still no vimlike editing in nvim's terminal.
Please let me know if there's a more comfortable way of doing it.
When returning to the terminal buffer
Could automatically add \
to the command to allow commands to span multiple lines
When command prompt is on last line of the buffer the text form the previous prompt to the eof is copied to the scratch buffer
Because terminal buffers are 'nomodifiable' clearing the commandline after we have extracted the command is a bit of a hack.
The only way I've found that works is to have the keypresses required directly inside of the mapping (or having them inside a macro which is called directly from the mapping).
Extracting them into their own function does not work.
execute 'normal!...' does not work.
'feedkeys()' cannot be used because it does not run till the script has completed.
If we had the job id of the terminal then we could do call jobsend(id, "^C")
but I'm unsure if terminals started using :terminal
even get a job id.
call termopen('/usr/local/bin/fish')
does return a job id so it could be used but then users would need to start their terminals via my plugin somehow, currently the plugin works regardless of how the terminal was started.
Sometimes Neovim will fail to return to insert mode in the terminal buffer after returning from the scratch buffer.
If the prompt is incorrectly configured, try and warn the user
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.