Git Product home page Git Product logo

dotfiles's Introduction

dotfiles

Dotfiles Backup

dotfiles 字面意思就是「点文件」,就是以.开头的文件,常见的如.bash_profile,.vimrc,.zshrc等等。在linux,osx等系统中,这些dotfiles默认都是隐藏的,在shell下要看到这些文件得用 ls -a 命令。常用到vim, iterm ,zsh ,sublime text2等等相关的工具和开发环境,为了用得顺手,也会根据个人习惯和喜好改改不同工具、环境的配置。

用法:

cd ~
git clone [email protected]:cuiqingwei/dotfiles.git .dotfiles
rm -rf .vimrc
ln -s .dotfiles/.vimrc .vimrc

vim

  1. vim-plug插件管理 (Launch vim and run :PluginInstall) https://github.com/VundleVim/Vundle.vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  1. VimAwesome https://vimawesome.com/

  2. .vimrc 快捷复制

" Author: Gary <[email protected]>
" Repository: https://github.com/cuiqingwei/dotfiles
" Create Date: 2016-03-23

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 通用设置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = ","                  " 定义<leader>键
set nocompatible                     " 设置不兼容原始vi模式
filetype on                          " 设置开启文件类型侦测
filetype plugin on                   " 设置加载对应文件类型的插件
syntax enable                        " 开启语法高亮功能
syntax on                            " 自动语法高亮

let mapleader = ","                  " 定义<leader>键
imap jj <Esc>
nmap <space> :

set number                           " 开启行号显示
set cursorline                       " 高亮显示当前行

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 搜索设置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set hlsearch                         " 高亮显示搜索结果
set incsearch                        " 开启实时搜索功能
set ignorecase                       " 搜索时大小写不敏感

set path+=**                         " 递归查找子文件,配合 :find *filename* 使用
set wildmenu                         " 展示匹配的文件列表

" quickfix for cscope
set cscopequickfix=s-,c-,d-,i-,t-,e- " 使用quickfix窗口来显示cscope结果, :cw 打开窗口,:cclose 关闭窗口

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 插件管理
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin()
Plug 'preservim/nerdtree'            " 文件浏览器,快捷键 ,n
Plug 'tpope/vim-commentary'          " 快速注释,常用快捷键 gcc
Plug 'Yggdroot/LeaderF'              " 模糊查找器 :Leaderf <subcommand>
Plug 'preservim/tagbar'              " 函数列表
Plug 'junegunn/fzf'                  " fzf存储库
Plug 'junegunn/fzf.vim'              " 模糊查找
Plug 'vim-airline/vim-airline'       " 多种风格的状态栏
call plug#end()

" nerdtree
nnoremap <silent> <leader>n :NERDTreeToggle<cr>
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
let g:NERDTreeHighlightFolders = 1
let g:NERDTreeHighlightFoldersFullName = 1
" let g:NERDTreeDirArrowExpandable='▷'
" let g:NERDTreeDirArrowCollapsible=''

" tagbar
let g:tagbar_width = 30
nnoremap <silent> <leader>t :TagbarToggle<cr>

" FZF
nnoremap <leader>f :Files .<cr>

" ack
nnoremap <leader>F :Ag<space>

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 其他配置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 编辑vimrc相关配置文件
nnoremap <leader>e :edit $MYVIMRC<cr>
" 重新加载vimrc文件
nnoremap <leader>s :source $MYVIMRC<cr>

" 打开当前光标所在单词的vim帮助文档
nnoremap <leader>H :execute ":help " . expand("<cword>")<cr>

" 安装、更新、删除插件
nnoremap <leader><leader>i :PlugInstall<cr>
nnoremap <leader><leader>u :PlugUpdate<cr>
nnoremap <leader><leader>c :PlugClean<cr>

" 复制当前选中到系统剪切板
vmap <leader><leader>y "+y

" 将系统剪切板内容粘贴到vim
nnoremap <leader><leader>p "+p

zsh

  1. Oh-My-Zsh https://ohmyz.sh/

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  2. plug:autojump https://github.com/wting/autojump

  3. plug:zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting

    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  4. plug:zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  5. themes https://github.com/ohmyzsh/ohmyzsh/wiki/themes

.tmux

Oh my tmux

cd ~
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
tmux source-file .tmux.conf

参考

Mathias’s dotfiles

Awesome dotfiles

VIM 实用插件整理

vimawesome

Mackup : osx系统下管理工具

tmux使用

How to Do 90% of What Plugins Do (With Just Vim)

dotfiles's People

Contributors

cuiqingwei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.