vim

数据库版本升级

て烟熏妆下的殇ゞ 提交于 2021-02-13 07:37:09
1.查看数据库的当前版本信息: [root@wzs6-1 ~]# mysql -V mysql Ver 15.1 Distrib 10.0.14-MariaDB, for Linux (x86_64) using readline 5.1 升级数据库到10.2版本 2.更新yum源 vim /etc/yum.repos.d/Centos.repo [mariadb] name=CentOS-$releasever - mariadb baseurl=10.2版数据库url gpgcheck=0 enabled=1 3.更新缓存 yum clean all yum makecache 4.注:升级时勿必要备份数据 cp /etc/my.cnf.d/* /backup/ #要备份一下数据库配置文件 yum remove -y MariaDB-Galera-server yum install -y MariaDB-server cp /backup/*.cnf /etc/my.cnf.d/ #还原配置文件 service mysql start 5.查看mysql数据库的版本: MariaDB [(none)]> select version(); +--------------------+ | version() | +--------------------+ | 10.2.6

Key bindings to send lines of test code with tmux+vim?

不打扰是莪最后的温柔 提交于 2021-02-11 14:26:44
问题 I am trying to create an ide-like setup with tmux + vim . I've seen a lot written about this on the internet, but I've been unable to figure out how to do one critical thing: execute test lines of code. For example, you may create a tmux session with a vim pane for writing code and a python pane for executing tests, like so: # Create a new Tmux session. session="ide" tmux start-server tmux new-session -d -s $session -n ide # Split the pane horizontally and launch vim. tmux selectp -t 1 tmux

Move Cursor Right When Typing ')' and Character Under Cursor is ')'

巧了我就是萌 提交于 2021-02-11 14:20:01
问题 I'm trying to use a combination of vim settings in .vimrc and vim functions to make the cursor move to the right when I type ')' IF there is already a ')'. What I've tried so far is adding the following to my .vimrc file: inoremap ) <Esc>:source PATH/TO/Function.vim<Enter> Where Function.vim is something like if getline('.')[col('.')] == ')' " move cursor two spaces right and re-enter insert mode else " move cursor one space right, enter insert mode, type ')' endif What commands can I use to

VIM command to insert spaces in after few characters?

偶尔善良 提交于 2021-02-11 13:55:58
问题 gvim command to insert a space or character after every few characters in a file example: How to add space after every 12 characters in the below lines? Before adding spaces: abcdefghijklmnopqrst dkdkefghijklmnopqrst After adding spaces abcdefghijkl mnopqrstvgah dkdkefghijkl mnopqrstbgdh 回答1: You can jump to the 12th column by typing 12| so: :%norm! 12|a<space> Where space is typed literally 回答2: A generalized version of this answer fits here perfectly: :'<,'>s/\(.\{12\}\)/\1 /g ^ |

vim/neovim callback on terminal command completion

落花浮王杯 提交于 2021-02-11 13:10:53
问题 So now both vim and neovim support terminal emulators inside them (with the terminal command). (I use neovim.) I often open a terminal inside vim and run some long running build/test command in it, I then close its window in order to save space for coding. I then have to check back on that terminal periodically to see if the command it ran has completed. Is there a way vim can listen to terminal command completion (through interprocess communication or some other way) ? That way I can

Vim overwrites filename when writing

喜你入骨 提交于 2021-02-10 18:02:34
问题 Let's say I have a file called FooBar.java. When I open the file in a powershell window with > vim foobar.java and write the file after editing it, the file gets renamed FooBar.java -> foobar.java. If I open the file with > vim FOOBAR.java it gets renamed FooBar.java -> FOOBAR.java. So Vim changes the name to be case sensitive to how I spelled it when I opened the file with a powershell command. This is undesired behaviour for me, and I did not have this problem earlier, before I did a clean

Vim save file in lower case

扶醉桌前 提交于 2021-02-10 15:54:04
问题 I got a new laptop. And now when i save a file with vim, the file name replace by lowercase name. Any idea on how to solve this? FileName.vhd -> filename.vhd I don't have this issue with notepad++ Best Regards, 回答1: Since I cannot make a comment, I will make an answer instead. This same problem has been solved here: Vim overwrites filename when writing In short: put set backupcopy=yes in your vimrc, or type :set backupcopy=yes in Vim to only apply it in the current session. This will make

Setting a vim variable to a python output

≯℡__Kan透↙ 提交于 2021-02-10 15:18:37
问题 How would I do something like the following in vim: echom "hello" pyx print('New item') let a = (pyx import socket; socket.gethostname()) echom a The first and second lines work; but how to assign a variable name to a python value/output? 回答1: Import module vim and execute vim's command let passing value from Python: :py3 import socket, vim; hn=socket.gethostname(); vim.command('let vim_hn="'+hn+ '"') hn=… assigns a variable in Python; 'let vim_hn="'+hn+ '"' passes its value to command let ;

Setting a vim variable to a python output

北城余情 提交于 2021-02-10 15:15:26
问题 How would I do something like the following in vim: echom "hello" pyx print('New item') let a = (pyx import socket; socket.gethostname()) echom a The first and second lines work; but how to assign a variable name to a python value/output? 回答1: Import module vim and execute vim's command let passing value from Python: :py3 import socket, vim; hn=socket.gethostname(); vim.command('let vim_hn="'+hn+ '"') hn=… assigns a variable in Python; 'let vim_hn="'+hn+ '"' passes its value to command let ;

How to efficiently copy code from editor to search field in VS Code using vscodevim?

☆樱花仙子☆ 提交于 2021-02-10 12:21:32
问题 This is currently how I copy code from an editor to a search field in VS code using vscodevim. Select text in editor somehow Right click to open up the contextual menu (since pressing Ctrl+C does not seem to work on Ubuntu, even when in input mode, and 'p' does not work in the search field) and click copy Press Ctrl+Shift+F to open the search field Press Ctrl+V I'm pretty sure this is not how copying from an editor to search field is intended to work. It it the steps 1 and 2 I would like to