idea vim配置

news/2024/7/21 3:46:40 标签: intellij-idea, vim, excel

"basemap 
"source $cnfpath/nvim/cnf/basemap.vim

"""""""""""""""""""""
" 自动设置
"""""""""""""""""""""

"""""""""""""""""""""
" 通用设置
"""""""""""""""""""""
"解决中文输入法
"在ibus里面添加代码 .config/ibus/rime/build/stroke.schema.yaml
"识别不同的文件格式
set nocompatible "is support old vim
filetype on
filetype indent on
filetype plugin on
filetype plugin indent on
autocmd FileType text setlocal textwidth=78
"monse =true
set mouse=""
"noremap <ScrollWheelUp>      <nop>
"noremap <S-ScrollWheelUp>    <nop>
"noremap <C-ScrollWheelUp>    <nop>
"noremap <ScrollWheelDown>    <nop>
"noremap <S-ScrollWheelDown>  <nop>
"noremap <C-ScrollWheelDown>  <nop>
"noremap <ScrollWheelLeft>    <nop>
"noremap <S-ScrollWheelLeft>  <nop>
"noremap <C-ScrollWheelLeft>  <nop>
"noremap <ScrollWheelRight>   <nop>
"noremap <S-ScrollWheelRight> <nop>
"noremap <C-ScrollWheelRight> <nop>
"总是显示状态栏
set laststatus=1
"状态行显示的内容 statue
"set statusline=%a%n\ %F\%m%r%w\ \ %{''.(&fenc!=''?&fenc:&enc).''}\ %{(&bomb?\",BOM\":\"\")}\ [%l,%v][%p%%]
" 不保存不提示
set hidden
"默认leader
"let mapleader = "\<Space>"
let mapleader = ";"


"高亮
syntax enable " 开启语法高亮功能
"syntax on
set number
"相对行号
set relativenumber
"set norelativenumber
"显示状态select模式下显示选中的行数
set showcmd
" 搜索高亮
set hlsearch
exec "nohlsearch"
nnoremap <Space><CR> :nohlsearch<CR>
"搜索实时预览
set incsearch

"忽略大小写
set ignorecase
"set noignorecase
"智能大小写
"set smartcase
"使光标始终和上下边缘相距3行
set scrolloff=8
"按键间隔 change key wait time neterror
"set notimeout
set timeoutlen=500
set viewoptions=cursor,folds,slash,unix
"注释
set formatoptions=tcrqn
"分平
set splitright
set splitbelow
"关闭显示模式 IVNC  statusbar
set noshowmode
"启动画面
set shortmess+=c
"优化滚动性能
"set ttyfast
"在执行宏命令时,不进行显示重绘;在宏命令执行完成后,一次性重绘,以便提高性能。
set lazyredraw
"bell
set visualbell

"列长度标尺
set colorcolumn=80
"自动更新时间
set updatetime=1000
"允许光标出现在最后一个字符的后面
set virtualedit=block
"记录光标配置
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif


"状态列的行数,预设一行,建议设成两行
set cmdheight=2

"与windows共享剪贴板
"set clipboard+=unnamed

set history=10
"""""""""""""""""""""
" 排版设置
"""""""""""""""""""""
" tab-py
set expandtab
"把制表符显示为^I ,用$标示行尾 TAB会被显示成 ">—" 而行尾多余的空白字符显示成 "-"
set list
set listchars=tab:>-,trail:-
set indentexpr=
" 退格不换行 del any
set backspace=indent,eol,start

" 下线
set cursorline
"当设置成 expandtab 时,缩进用空格来表示,noexpandtab 则是用制表符表示一个缩进
set expandtab
" vim中默认的缩进为8个空格 set ts=4
set tabstop=4
set shiftwidth=4
set softtabstop=4
"自动缩进
set autoindent
"set paste
set nopaste
"nnoremap  <F7> :set paste<CR>
"nnoremap  <F8> :set autoindent<CR>

"show tab
set showtabline=2
"自动换行
set wrap
set tw=0
nnoremap <Space>n :set nowrap<CR>
nnoremap <Space>N :set wrap<CR>
nnoremap <leader>sp :set paste<CR>
nnoremap <leader>sP :set nopaste<CR>
"操作:za,打开或关闭当前折叠;zM,关闭所有折叠;zR,打开所有折叠

"indent方式,vim会自动利用缩进进行折叠,我们可以使用现成的折叠成果.
"我们可以在(括号)折叠处输入以下命令:

"zc 折叠
"zC 对所在范围内所有嵌套的折叠点进行折叠
"zo 展开折叠
"zO 对所在范围内所有嵌套的折叠点展开
"[z 到当前打开的折叠的开始处。
"]z 到当前打开的折叠的末尾处。
"zj 向下移动。到达下一个折叠的开始处。关闭的折叠也被计入。
"zk 向上移动到前一折叠的结束处。关闭的折叠也被计入。
"折叠方式 indent 所有 diff无更改折叠 syntax marker  manual手动
set foldmethod=indent
nnoremap <leader>zc2 :set foldlevel=2<CR>
nnoremap <leader>zc3 :set foldlevel=3<CR>
nnoremap <leader>zc4 :set foldlevel=4<CR>
nnoremap <leader>zc5 :set foldlevel=5<CR>
nnoremap <leader>zC :set foldlevel=99<CR>
"开启折叠
set foldlevel=99
set foldenable
"关闭折叠
"set nofoldenable
"nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
"Fill space between windows 在被分割的窗口间显示空白,便于阅读
set fillchars=vert:\ ,stl:\ ,stlnc:\

"显示标尺 :statusBar态行上显示光标所在位置的行号和列号
"set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)

    "缩进
"map <Tab> >>
"map <S-Tab> <
" key notation
"
"行首 行未
"nnoremap <leader>a 0
nnoremap <leader>' $
nnoremap <leader>l 0

inoremap jk <ESC>
"vnoremap jk <ESC>

"分屏
"nmap sv :set splitright<CR>:vsplit<CR>
"nmap ss :set splitbelow<CR>:split<CR>


nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"nmap <space>h <C-w>h
"nmap <space>j <C-w>j
"nmap <space>k <C-w>k
"nmap <space>l <C-w>l
nmap <DOWN> :res +5<CR>
nmap <UP> :res -5<CR>
nmap <RIGHT> :vertical resize+5<CR>
nmap <LEFT> :vertical resize-5<CR>

"快速移动
nmap J 5j
nmap K 5k
nmap H 5h
nmap L 5l
inoremap <C-h> <Left>
inoremap <C-l> <Right>
inoremap <C-k> <Up>
inoremap <C-j> <Down>
inoremap <C-b> <PageUp>
inoremap <C-f> <PageDown>
"inoremap <C-d> <DELETE>
inoremap <C-d> <Backspace>


"快速复制
vnoremap <space>c "+y
vnoremap <space>1y "9y
vnoremap <space>2y "8y
nnoremap <space>1p "9p
nnoremap <space>2p "8p
nnoremap <space>o "0p
vnoremap <space>v "+p
vnoremap <space>x "+x
nnoremap <space>c viw"+y
nnoremap <space>p diwh"+p
function! CopyCode()
    :set paste
    :"+p
    :set nopaste
    "silent! call PhpCsFixerFixFile() 
endfunction
nnoremap <space>p diwh"+p

"imap <C-V>        "+gP
"map <C-V> "+p
"noremap i H

"保存文件
map S :w<CR>
"禁用s删除
map s <nop>
"推出
map Q :q<CR>
"刷新
map <Leader>R :source ~/.config/nvim/init.vim<CR>
map E :e<CR>
" 取消行号
"map N :set nu<CR>
"map n :set nonu<CR>
"fzf
"nnoremap <Leader>f :Files<CR>
"nnoremap <Leader>F :Rg<CR>
"nnoremap <Leader>t :Lines<CR>
"nnoremap <Leader>h :History<CR>
"nnoremap <Leader>b :Buffers<CR>
"tab切换
nnoremap bl :bn<CR>
nnoremap bd :call BufferDel()<CR>
"tab切换
nnoremap bh :bp<CR>
function! BufferDel()
    :bp|bd #
    "silent! call PhpCsFixerFixFile() 
endfunction

"copy path
"nnoremap <Leader>p :let @+=expand('%:p')<CR>

"nnoremap <Leader>P :let @+=expand('%:t')<CR>
"复制当前文件的绝对路径
noremap <Leader>p  :action CopyAbsolutePath<CR>
"复制当前文件名
noremap <Leader>P  :action CopyContentRootPath<CR>


"svn
nmap  <Leader>su :!svn up<CR>
nmap  <Leader>si :call Svnci()<CR>
nmap  <Leader>sd :!svn diff %<CR>
nmap  <Leader>go :!git checkout %<CR>
nmap  <Leader>sr :!svn revert %<CR>
nmap  <Leader>st :!svn st %<CR>

"" vim en chinese
set keep-english-in-normal
"set keep-english-in-normal-and-restore-in-insert

"" reload
set idearefactormode=keep
set ideajoin


set easymotion
nmap <leader>s <Plug>(easymotion-sn)
nmap <Leader>w <Plug>(easymotion-overwin-w)

set NERDTree
map tt :NERDTreeToggle<CR>
map tf :NERDTreeFind<CR>
let NERDTreeMapOpenExpl = ""
let NERDTreeMapUpdir = ""
let NERDTreeMapUpdirKeepOpen = ""
let NERDTreeMapOpenSplit = "s"
let NERDTreeOpenVSplit = "v"
let NERDTreeMapActivateNode = "l"
let NERDTreeMapOpenInTab = "t"
let NERDTreeMapPreview = "p"
let NERDTreeMapCloseDir = "h"
let NERDTreeMapChangeRoot = "r"

set surround
" cia
set argtextobj
"set visual-multi
set multiple-cursors
""" remap multiple-cursors
""" 避免了<A-n>键与Navigate导航栏的按键冲突
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
" nmap g<C-A-n> <Plug>NextOccurrence
" xmap g<C-A-n> <Plug>NextOccurrence
" nmap <C-x> <Plug>SkipOccurrence
" xmap <C-x> <Plug>SkipOccurrence
" nmap <C-p> <Plug>RemoveOccurrence
" xmap <C-p> <Plug>RemoveOccurrence


"let multi_cursor_use_default_mapping=0
"let multi_cursor_next_key='<C-n>'
"let multi_cursor_prev_key='<C-p>'
"let multi_cursor_skip_key='<C-x>'
"let multi_cursor_quit_key='<Esc>'

" 重构重命名
nnoremap <leader>r :action RenameElement<CR>
" 格式化当前文件
nnoremap <leader>cf :action ReformatCode<CR><esc>
"文件跳转
"noremap <Space>tf mm`m:action GotoFile<CR>

" quick java doc
nnoremap <leader>q :action QuickJavaDoc<CR>
"搜索任何位置 b
noremap <Leader>f :action SearchEverywhere<CR>
"文本搜索
noremap <Leader>B :action FindInPath<CR>
"打开最新文件列表
noremap <Leader>b :action RecentFiles<CR>

"改变视图symotion-sn)
"nnoremap <Space>cv :action ChangeView<CR>
"debug神器
"nmap <C-j> :action StepOver<CR>
"nmap <C-k> :action Resume<CR>
"nmap <C-h> :action StepOut<CR>
"nmap <C-l> :action ForceStepInto<CR>
"跳转 需要安装AceJump插d大幅度件
"noremap <Space>tj mm`m:action AceWordAction<CR>
"noremap <Space>jp mm`m:action AceDeclarationAction<CR>
"跳转下个报错处
noremap <Leader>ne mm`m:action GotoNextError<CR>
"跳转上个报错处
noremap <Leader>pe mm`m:action GotoPreviousError<CR>
"java类跳转
"noremap <Space>tc mm`m:action GotoClass<CR>
"从子类方法跳到父类的方法
"noremap <Space>gs mm`m:action GotoSuperMethod<CR>
"跳到方法实现
noremap <Leader>ii mm`m:action GotoImplementation<CR>
"跳回方法实现
noremap <Leader>ij mm`m:action GotoDeclaration<CR>
"new function
noremap <Leader>nf mm`m:action ExtractMethod<CR>
"new code block
noremap <Leader>sw mm`m:action SurroundWith<CR>
"noremap <Leader>im mm`m:action ImplementMethods<CR>
"万能重构"
"打开函数列表
noremap <Leader>T mm`m:action ActivateStructureToolWindow<CR>

noremap <Leader>u mm`m:action LocalHistory<CR>

"Ter common+T


 


http://www.niftyadmin.cn/n/5367844.html

相关文章

JVM相关-JVM模型、垃圾回收、JVM调优

一、JVM模型 JVM内部体型划分 JVM的内部体系结构分为三部分&#xff0c;分别是&#xff1a;类加载器&#xff08;ClassLoader&#xff09;子系统、运行时数据区&#xff08;内存&#xff09;和执行引擎 1、类加载器 概念 每个JVM都有一个类加载器子系统&#xff08;class l…

【LeetCode: 73. 矩阵置零 + 矩阵】

&#x1f680; 算法题 &#x1f680; &#x1f332; 算法刷题专栏 | 面试必备算法 | 面试高频算法 &#x1f340; &#x1f332; 越难的东西,越要努力坚持&#xff0c;因为它具有很高的价值&#xff0c;算法就是这样✨ &#x1f332; 作者简介&#xff1a;硕风和炜&#xff0c;…

2.6作业

一、填空题 1、一个类的头文件如下所示&#xff0c;num初始化值为5&#xff0c;程序产生对象T&#xff0c;且修改num为10&#xff0c;并使用show()函数输出num的值10。 #include <iostream.h> class Test { private: static int num; public: Test(int); void show(); };…

使用PaddleNLP识别垃圾邮件:用BERT做中文邮件内容分类,验证集准确率高达99.6%以上(附公开数据集)

使用PaddleNLP识别垃圾邮件:用BERT做中文邮件内容分类,验证集准确率高达99.6%以上(附公开数据集)。 要使用PaddleNLP和BERT来识别垃圾邮件并做中文邮件内容分类,可以按照以下步骤进行操作: 安装PaddlePaddle和PaddleNLP:首先,确保在你的环境中已经安装了PaddlePaddle和…

vue项目开发vscode配置

配置代码片段 步骤如下&#xff1a; 文件->首选项->配置用户代码片段新增全局代码片段起全局代码片段文件名“xxx.code-snippets” 这里以配置vue2初始代码片段为例&#xff0c;配置具体代码片段 {"name": "vue-sph","version": "…

【深度学习】基于PyTorch架构神经网络学习总结(基础概念基本网络搭建)

神经网络整体架构 类似于人体的神经元 神经网络工作原来为层次结构&#xff0c;一层一层的变换数据。如上述示例有4层&#xff0c;1层输入层、2层隐藏层、1层输出层神经元&#xff1a;数据的量或矩阵的大小&#xff0c;如上述示例中输入层中有三个神经元代表输入数据有3个特征…

Day 38 | 动态规划 理论基础 、 509. 斐波那契数 、 70. 爬楼梯 、746. 使用最小花费爬楼梯

理论基础 文章讲解 视频讲解 动态规划五部曲 509. 斐波那契数 题目 文章讲解 视频讲解 思路&#xff1a; class Solution {public int fib(int n) {if (n < 2)return n;int a 0, b 1, c 0;for (int i 1; i < n; i) {c a b;a b;b c;}return c;} }70. 爬楼梯…

【数据结构】链表OJ面试题3(题库+解析)

1.前言 前五题在这http://t.csdnimg.cn/UeggB 后三题在这http://t.csdnimg.cn/gbohQ 记录每天的刷题&#xff0c;继续坚持&#xff01; 2.OJ题目训练 9. 给定一个链表&#xff0c;判断链表中是否有环。 力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成…