vim

linux中安装配置vnc

别等时光非礼了梦想. 提交于 2020-01-03 21:28:32
要求在图形化界面的虚拟机 安装实验环境 [root@localhost ~]# yum install -y vnc-server vnc vim 启动VNCSERVER [root@localhost ~]# vncserver :1 You will require a password to access your desktops. Password:自己设置的密码 Verify:和上述一样就行 New 'localhost:1 (zx)' desktop is localhost:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost:1.log 配置VNC [root@localhost ~]# vim /etc/sysconfig/vncservers VNCSERVERS="2:hubery" VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost" 在远程Windows机器安装VNC Viewer软件并打开 来源: CSDN 作者: ni gei wo

How to sort methods into alphabetical order in VIM?

眉间皱痕 提交于 2020-01-03 18:54:13
问题 class MyClass def zzz # method body end def aaa # method body end end How would I get VIM to organise these into alphabetical order such that the definition of aaa precedes the definition of zzz? 回答1: Well you can set up code folding e.g. by indentation, and close those functions/fold, then do it manuall with d d then p but that is not an ideal solution with a large file. It's not an easy task. You can set up some line-joining, e.g.: put some specific comment/identifier before every first

How to bind vim (through tmux) to Cmd key

£可爱£侵袭症+ 提交于 2020-01-03 17:42:08
问题 I usually use macvim, and have a number of key bindings using my macs command key. I'm trying to switch over to tmux, but none of those bindings are working. Any tips on how to modify my .tmux.config or .vimrc to get those bindings back? 回答1: Do you, by any chance, use <D-> to emulate another editor's shortcuts? You can use the command key for mappings only in MacVim. There is no Vim-specific workaround. This is because this key is "intercepted" by Terminal.app (or iTerm.app) for its own use

How to bind vim (through tmux) to Cmd key

倖福魔咒の 提交于 2020-01-03 17:42:04
问题 I usually use macvim, and have a number of key bindings using my macs command key. I'm trying to switch over to tmux, but none of those bindings are working. Any tips on how to modify my .tmux.config or .vimrc to get those bindings back? 回答1: Do you, by any chance, use <D-> to emulate another editor's shortcuts? You can use the command key for mappings only in MacVim. There is no Vim-specific workaround. This is because this key is "intercepted" by Terminal.app (or iTerm.app) for its own use

Why would vim create a new file every time you save a file?

半腔热情 提交于 2020-01-03 15:29:14
问题 I have a file named test : [test@mypc ~]$ ls -i 4982967 test Then I use vim to change its content and enter :w to save it. It now has a different inode: [test@mypc ~]$ ls -i 4982968 test That means it's a different file already, why would vim save it to another file as I use :w to save to the original one? You see, echo to a file will not change the inode, which is expected: [test@mypc ~]$ echo v >> test [test@mypc ~]$ ls -i 4982968 test 回答1: It is trying to protect you from disk and os

backward-kill-word in vim?

喜夏-厌秋 提交于 2020-01-03 14:16:11
问题 is the quickest way to go back and kill a word Esc or Ctrl-[ and db ? I guess I mess up a lot :P and am used to using M-<backspace or Ctrl-<backspace> in other editors (or word processors). Still getting the hang of this (vim), but switching to normal-mode for short tasks like this one seems an odd way to go about it. Just wanted to inquire if there was anything better than what I was doing... Thanks much ~ 回答1: In insert mode you can use CTRL-W to undo the most recently typed word. 回答2: Are

How can I display the function name in vim-airline?

时间秒杀一切 提交于 2020-01-03 13:35:49
问题 I'm using the ctags vim plugin to have the name of the current C function (=where the cursor is) displayed in the status line. Today I installed the vim-airline plugin. Fancy, but the C function name is no longer displayed in the status line. There is lots of room for more text. Is there a way to make ctags.vim and airline coexist or some other technique to show the function name somewhere in the status line like ctags does? I searched the :help airline for function but that did not answer my

How can I display the function name in vim-airline?

天大地大妈咪最大 提交于 2020-01-03 13:33:10
问题 I'm using the ctags vim plugin to have the name of the current C function (=where the cursor is) displayed in the status line. Today I installed the vim-airline plugin. Fancy, but the C function name is no longer displayed in the status line. There is lots of room for more text. Is there a way to make ctags.vim and airline coexist or some other technique to show the function name somewhere in the status line like ctags does? I searched the :help airline for function but that did not answer my

In Vim, how to delete the suffix of a word?

 ̄綄美尐妖づ 提交于 2020-01-03 09:08:12
问题 In vim, in normal mode, if the cursor is in a word, not the last letter, de deletes the suffix of the word, from the position of the cursor. If the cursor is on the last letter, x does it too, while de would jump to the end of the next word. What command would you use that would work in both cases, last letter or not? The purpose is to include the command in a macro. 回答1: Try vwged instead of de , and define a mapping like the following, if you like it. :nnoremap <leader>de vwged It seems to

vscode中vim插件配置及其余插件安装

。_饼干妹妹 提交于 2020-01-03 08:55:20
vscodevim安装 在扩展中搜索vim 选择vscodevim 进入vscodevim设置 修改settings.json 将以下代码加入其中 { “workbench.colorTheme”: “Abyss”, “vim.easymotion”: true, “vim.sneak”: true, “vim.incsearch”: true, “vim.useSystemClipboard”: true, “vim.useCtrlKeys”: true, “vim.hlsearch”: true, “vim.insertModeKeyBindings”: [ { “before”: [“j”, “j”], “after”: [""] } ], “vim.normalModeKeyBindingsNonRecursive”: [ { “before”: ["", “w”], “after”: [":w"] }, { “before”: ["",“w”], “commands”: [":w"] }, { “before”: ["",“q”], “commands”: [":q"] }, { “before”: ["",“u”], “commands”: [":sp"] }, { “before”: ["",“r”], “commands”: [":vsp"] }, {