linux常用配置

                                         linux中各种配置快捷命令

配置软件包启动快捷命令:

第一次使用su时,请先使用sudo passwd设置超级用户密码

$sudo  apt-get  install  unity-tweak-tool  

$unity-tweak-tool

安装界面设置软件

/etc/profile文件全局配置,.bashrc当前用户配置

 

打开文件命令

sudo vim .bashrc          建议写在/etc/profile中,所有用户都可以使用

将解压的软件包解压并放到/usr/local下

alias vscode="/usr/local/vscode/bin/./code"
alias idea="/usr/local/idea/bin/./idea.sh"
alias firefox="/usr/local/firefox/firefox-bin"
alias pyuic="python3 -m PyQt5.uic.pyuic"        #qt-designer工具.ui编译.py命令使用

#jdk  环境配置
export JAVA_HOME=/usr/local/jdk
export JAVA_BIN=$JAVA_HOME/bin
export JAVA_LIB=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jar
export PATH=$JAVA_BIN:$PATH

配置vim:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 

为了使用tagbar必须下载ctags

sudo apt install exuberant-ctags

sudo vim .vimrc

syntax enable syntax on
"语法高亮"
set shiftwidth=4
"缩进"

set nu 
"显示行号"
set lines=30 columns=70
"大小"
set paste 
"粘贴"
set mouse=a 
"启用鼠标"
set fileencodings=utf-8,gbk
set tabstop=4
set autoindent
set smartindent
set hlsearch 
"高亮搜索"
set autochdir
"自动切换到当前文件目录"
set showmatch
"括号匹配"
set incsearch
"边输入边搜索(实时搜索)"
set history=1000
"记录历史的行数"
"set cursorline"
"突出显示当前行"
set ruler 
"打开状态栏标尺"
set cmdheight=1
"命令行的行数为1"
set foldenable
"开启折叠"
set foldmethod=syntax
"语法折叠"
set ignorecase
"忽略大小写检索"
set wildmenu
"vim命令自动补全"
set laststatus=2
"显示状态栏(默认为1,无法显示状态栏)"
set nocompatible
set foldmethod=syntax
set foldlevel=100 
"启动vim时不要自动折叠代码"
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_width=20
let g:tagbar_left=1
autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen()

"let g:winManagerWidth=35"
nmap <F5> :NERDTreeToggle<cr>
nmap <F6> :TagbarToggle<cr>
"nmap <F6> :WMToggle<cr>"


set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"始终第一个插件"
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
"目录树"
Plugin 'mbriggs/mark.vim'
"标记高亮"

Plugin 'majutsushi/tagbar'
"显示函数列表等信息"
Plugin 'bling/vim-airline'
"状态栏"
Plugin 'Valloric/YouCompleteMe'
"自动补全"
Plugin 'davidhalter/jedi-vim'
"python的自动补全"
Plugin 'kien/ctrlp.vim'
"文件查找"
Plugin 'godlygeek/tabular'
"快速对齐"
Plugin 'Raimondi/delimitMate'
"自动补全引号,括号"
Plugin 'othree/html5.vim'
"html5标签支持"
Plugin 'scrooloose/syntastic'
"语法检测"
Plugin 'jiangmiao/auto-pairs'
"括号匹配"
Plugin 'comments.vim'
"快速注释"
Plugin 'winmanager'
"窗口管理"
call vundle#end()
filetype plugin indent on
"开启插件"

在vim中使用PluginInstall

单击左侧图标缩小打开的软件

gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-minimize-window true

第二次重新配置vim

效果图:(右侧tagbar+nerdtree上下依次排序)

.vimrc配置文件信息:

syntax enable 
syntax on
set nu
set mouse=a
set hlsearch
set autochdir
set incsearch
set history=1000
set ruler
set cmdheight=1
set shortmess=atI
"启动时不显示援助乌干达儿童的提示
winpos 5 5
"设定窗口位置
set lines=130 
set columns=80
"窗口大小
set foldenable 
"允许折叠
set foldmethod=manual
"手动折叠
set magic
set nobackup
set noswapfile
"禁止生成临时文件
set smartindent
let autosave=60
"自动保存,60s

let NERDTreeMinimalUI=1
"去除第一行的帮助提示
let NERDTreeWinSize=28
autocmd bufenter * if (winnr("$")==1&&exists("b:NERDTreeType")&&b:NERDTreeType=="primary")|q|endif
"自动退出
autocmd vimenter * NERDTree
"打开vim时自动打开
let g:tagbar_vertical=15
let g:tagbar_compact=1
"去除第一行的帮助信息
let g:tagbar_autoshowtag=1
"当编辑代码时,在tagbar自动追踪变量
autocmd VimEnter * wincmd 1
"如果不加这句,打开vim时,当前光标会在nerdtree区域
autocmd VimEnter * nested :TagbarOpen
wincmd 1
"打开vim时自动打开
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
"调试并运行C语言
map <F6> :call CompileRunGpp()<CR>
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
"调试并运行c++
"nmap <F5> :NERDTreeToggle<cr>
"nmap <F6> :TagbarToggle<cr>

"nmap <F4> :WMToggle<cr>
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'majutsushi/tagbar'
Plugin 'bling/vim-airline'
Plugin 'Valloric/YouCompleteMe'

Plugin 'scrooloose/syntastic'
Plugin 'jiangmiao/auto-pairs'
Plugin 'winmanager'
call vundle#end()
filetype plugin indent on

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值