Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure my linux development environment with vim

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to configure my linux development environment with vim. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

"Show line number set number" parcel line set wrap "set file encoding set encoding=utf-8" settings file open title set titlestring=%t "Show cursor position set ruler" syntax highlight syntax on "indent format setting set autoindent" automatically wrap, inherit the previous line of indentation mode, apply to multi-line comments set expandtab "convert tab to spaces, the expandtab option is used to set when pressing the Tab key in Vim insert mode, enter into the Vim are spaces. Smarttab indicates that shiftwidth is used when inserting Tab. " Tab is changed to 4 spaces set tabstop=4 "when setting copy and paste, set shiftround" indicates that the number of indented columns is aligned to an integral multiple of the shiftwidth value set shiftwidth=4set smarttabset tabstop=4set softtabstop=4 "insert mode tab and backspace use 4 spaces" search setting set hlsearch "search highlight set ignorecase" case-insensitive, https://harttle.land/2019/12/12/vim-case-sensitive.htmlset incsearch "enter each character when entering search mode Automatically jump to the first matching result set smartcase "https://www.ruanyifeng.com/blog/2018/09/vimrc.html, if ignorecase is opened at the same time, the search term with only one uppercase letter will be case-sensitive. Everything else is case-insensitive. For example, when searching for Test, it will not match test;. When searching for test, it will match Test.

When set noerrorbells goes wrong, don't make a noise. When set visualbell goes wrong, give a visual cue, usually the screen flashes. Set history=1000 "Vim" how many historical operations need to be remembered. Set autoread "turns on file monitoring. If the file changes externally during editing (such as being edited by another editor), a prompt will be issued. Set listchars=tab: »■, trail: ■ "if there are extra spaces at the end of the line (including the Tab key), this configuration will make those spaces appear as small visible squares. Set listset wildmenuset wildmode=longest:list,full" command mode, the bottom operation instruction press the Tab key to automatically complete. The first time you press Tab, a list of all matching action instructions is displayed; the second time you press Tab, each instruction is selected in turn.

"enable collapse set foldenable

"Show cursor position set cursorcolumn" setting highlight the current column of the cursor set cursorline "setting highlight the screen line where the cursor is located

"paste, paste with the right mouse button in Vim will add a lot of indentation and spaces at the beginning of the line. Through set paste, you can paste content in insert mode without any problems such as format distortion, random indentation and so on. Set paste.

Set showcmd "is used to set the command to be displayed (partially) on the last line of the screen. Showmode provides messages on the last line in insert, replace, and visual modes." set showmatch "means to briefly jump to the corresponding parenthesis when inserting parentheses, while the length of stay is set by the matchtime option. If you set 'showmatch',matchtime' to show 1/10 seconds of pairing parentheses set matchtime=2 "matchtime means to display pairing parentheses for 1/10 seconds

"move settings, move nnoremap j gjnnoremap k gkxnoremap vertically through the line of sight <

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report