Idea vimrc

"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      
"noremap    
"noremap    
"noremap    
"noremap  
"noremap  
"noremap    
"noremap  
"noremap  
"noremap  
"noremap
"noremap
"总是显示状态栏
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 = "\"
let mapleader = ";"


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

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

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

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

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

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

inoremap jk
"vnoremap jk

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


nnoremap h
nnoremap j
nnoremap k
nnoremap l
"nmap h h
"nmap j j
"nmap k k
"nmap l l
nmap :res +5
nmap :res -5
nmap :vertical resize+5
nmap :vertical resize-5

"快速移动
nmap J 5j
nmap K 5k
nmap H 5h
nmap L 5l
inoremap
inoremap
inoremap
inoremap
inoremap
inoremap
"inoremap
inoremap


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

"imap        "+gP
"map "+p
"noremap i H

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

"copy path
"nnoremap p :let @+=expand('%:p')

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


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

"" 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
set NERDTree
map tt :NERDTreeToggle
map tf :NERDTreeFind
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
"set vim-visual-multi
set multiple-cursors
let multi_cursor_use_default_mapping=0
"let multi_cursor_next_key=''
"let multi_cursor_prev_key=''
"let multi_cursor_skip_key=''
"let multi_cursor_quit_key=''

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

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

"改变视图
"nnoremap cv :action ChangeView
"debug神器
"nmap :action StepOver
"nmap :action Resume
"nmap :action StepOut
"nmap :action ForceStepInto
"跳转 需要安装AceJump插件
"noremap tj mm`m:action AceWordAction
"noremap jp mm`m:action AceDeclarationAction
"跳转下个报错处
noremap ne mm`m:action GotoNextError
"跳转上个报错处
noremap pe mm`m:action GotoPreviousError
"java类跳转
"noremap tc mm`m:action GotoClass
"从子类方法跳到父类的方法
"noremap gs mm`m:action GotoSuperMethod
"跳到方法实现
noremap ii mm`m:action GotoImplementation
"new function
noremap nf mm`m:action ExtractMethod
"new code block
noremap sw mm`m:action SurroundWith
"noremap im mm`m:action ImplementMethods
"万能重构"
"noremap R mm`m:action RefactorThis


 

你可能感兴趣的:(intellij-idea,java,ide)