vi

Vim bindings for jupyter notebook/lab like Colab

半城伤御伤魂 提交于 2021-02-18 17:34:49
问题 Is there some way to have vim bindings in jupyter notebook/lab like in colab. In the included vim bindings for jupyter Lab, there isn't a NORMAL mode for editing inside the cell block. Colab however has better bindings as it allows use inside the cell block. 来源: https://stackoverflow.com/questions/59746583/vim-bindings-for-jupyter-notebook-lab-like-colab

Git command output shows special characters

本秂侑毒 提交于 2021-02-17 03:56:11
问题 For the past few days, we are seeing a strange behavior on executing Git commands. Command executed: git show 08fcf54adc7bbb75a54b14625fdeea7608d44a23 > sample.patch On opening the file sample.patch through vi editor , we are seeing a lot of special characters; a sample output file looks like: ^[[33mcommit 08fcf54adc7bbb75a54b14625fdeea7608d44a23^[[m Author: Anshul Gupta <anshul.gupta@lnttechservices.com> Date: Wed Nov 26 23:27:20 2014 +0400 Remove redundant logs from EPD driver Change-Id:

How to get Prettier working with js files in vim?

那年仲夏 提交于 2021-02-08 11:27:50
问题 I followed https://github.com/prettier/vim-prettier instructions and added // @format at the top of my .js files. I installed prettier with cd ~/.vim/bundle/ git clone https://github.com/prettier/vim-prettier but I can't see to get Prettier to work, either on file save or by using :Prettier at the ex command line. Nothing changes At the command line, when I run $ npx prettier-eslint $PWD/'**/*.js' I get newly formatted output as expected. package.json includes "devDependencies": { "eslint": "

VI delete everything except a pattern

不打扰是莪最后的温柔 提交于 2021-02-07 22:32:30
问题 I have a huge JSON output and I just need to delete everything except a small string in each line. The string has the format "title": "someServerName" the "someServerName" (the section within quotes) can vary wildly. The closest I've come is this: :%s/\("title":\s"*"\) But this just manages to delete "title": " The only thing I want left in each line is "title": "someServerName" EDIT to answer the posted question: The Text I'm going to be working with will have a format similar to {"_links":

VI delete everything except a pattern

我怕爱的太早我们不能终老 提交于 2021-02-07 22:31:05
问题 I have a huge JSON output and I just need to delete everything except a small string in each line. The string has the format "title": "someServerName" the "someServerName" (the section within quotes) can vary wildly. The closest I've come is this: :%s/\("title":\s"*"\) But this just manages to delete "title": " The only thing I want left in each line is "title": "someServerName" EDIT to answer the posted question: The Text I'm going to be working with will have a format similar to {"_links":

how to edit text in multiple columns in vim

家住魔仙堡 提交于 2021-02-05 12:52:41
问题 How can I edit my code in Vim by displaying it in any number of columns? My laptop and desktop monitors are widescreen (I suspect that is true of most monitors made in the last 5 or 10 years!). When I open any editor in full screen, more than half the screen is completely empty. I'd like to be able to effectively use the rest of the screen by splitting it into two or three columns so I can see all much more of my code in a single screen. Frankly, I'm surprised that other than Microsoft Word,

Possible to add spacing every 4 characters in vi?

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-27 06:07:53
问题 Is it possible to add spacing every 4 characters in vi? And if it is, what's a good google term to search for to learn how to do similar stuff? 回答1: To add a space every 4 characters you could use the following command (at least in VIM): :%s/\(....\)/\1 /g If you Google "VIM Substitution" you should end up with some useful examples. Example: To add a space every 4 characters you could use becomes To a dd a spa ce e very 4 c hara cter s yo u co uld use 来源: https://stackoverflow.com/questions

Possible to add spacing every 4 characters in vi?

自古美人都是妖i 提交于 2021-01-27 06:06:20
问题 Is it possible to add spacing every 4 characters in vi? And if it is, what's a good google term to search for to learn how to do similar stuff? 回答1: To add a space every 4 characters you could use the following command (at least in VIM): :%s/\(....\)/\1 /g If you Google "VIM Substitution" you should end up with some useful examples. Example: To add a space every 4 characters you could use becomes To a dd a spa ce e very 4 c hara cter s yo u co uld use 来源: https://stackoverflow.com/questions

Delete everything between two brackets in Vim, including newlines

寵の児 提交于 2021-01-21 07:03:11
问题 Say I have the following python array literal: def f(): arr = [ 1, 2, 3 ] I want to delete everything in the brackets so that it becomes this: def f(): arr = [] How can I do that with minimal commands in vim? These are some of my attempts: Using di] will delete the text, but not the empty newlines, leaving a lot of whitespace I'd have to delete: def f(): arr = [ ] Using da] will delete the newlines, but also the brackets: def f(): arr = 回答1: You can simply do: ca[[]<Esc> or: ca][]<Esc> See

Vim - delete until (inclusive) character in multiple lines

▼魔方 西西 提交于 2020-12-29 09:06:24
问题 I have this code: def foo(c: Char) = c match { case 'a': 'B' } My cursor is on the space after = . I want to delete everything until, including, the } . How can I do that? Can I do the same where the cursor is anywhere on the first line? Anywhere in the block (and place the cursor after the = )? 回答1: d/}/e does the job. d/} deletes until the } but adding the /e flag moves the cursor on the last char of the match, effectively deleting everything between the cursor and the } , inclusive . Using