Skip to content

Instantly share code, notes, and snippets.

@coder-ghw
Last active November 3, 2024 14:05
Show Gist options
  • Save coder-ghw/793a8a0f37e453714eaacdf4b4350238 to your computer and use it in GitHub Desktop.
Save coder-ghw/793a8a0f37e453714eaacdf4b4350238 to your computer and use it in GitHub Desktop.
dotfile
#debian-11 换源
sed -i 's@http://\(deb\|security\).debian.org@https://mirrors.aliyun.com@g' /etc/apt/sources.list
#ubuntu换源
sed -i 's/http:\/\/.*.ubuntu.com/https:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list
set nocompatible
let mapleader = ","
let g:mapleader = ","
set wildmenu
set showmatch
set hlsearch
set incsearch
set noeb
set ignorecase
set smartcase
set enc=utf-8
set fileencoding=utf-8
set laststatus=2
set t_Co=256
set colorcolumn=95
set number
set relativenumber
set expandtab
set smartindent
set softtabstop=4
set shiftwidth=4
set mouse=a
set backspace=indent,eol,start
set cursorline
set guifont=Monaco:h10
"==================="
"程序开发相关的设置"
"==================="
"(1)使用%来选择语句块,然后使用快捷键zf来折叠"
set foldmethod=marker
"(2)注释:选中文本后,输入;c即可注释,输入;u 即可取消注释"
vmap <silent> ;c :s/^/\/\//<CR>:noh<CR>
vmap <silent> ;u :s/\/\///<CR>:noh<CR>
"============"
"多窗口操作"
"============"
map <C-l> <C-W>l
map <C-h> <C-W>h
map <C-j> <C-W>j
map <C-k> <C-W>k
"=========================="
"不要交换文件和备份文件,减少冲突"
"=========================="
set noswapfile
set nobackup
set nowritebackup
"============="
"查找和替换文本"
"============="
nmap ;s :%s/\<<C-R>=expand("<cword>")<CR>\>/
nmap ;g :vimgrep <C-R>=expand("<cword>")<CR>
"========================"
"快捷文本输入"
"========================"
map <silent> \d a<C-R>=strftime("%Y/%m/%d %A")<CR>
map <silent> \t a<C-R>=strftime("%Y/%m/%d %H:%M:%S")<CR>
map <silent> ,d :split ~/Dropbox/Doc/ <CR>
iab --l --------------------
iab ==l ====================
nnoremap <silent> <leader>/ :nohlsearch<CR>
inoremap jj <Esc>
nnoremap H 0
nnoremap L $
{
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
}
],
"vim.normalModeKeyBindings": [
{
"before": ["<C-h>"],
"after": ["<C-w>", "h"]
},
{
"before": ["<C-j>"],
"after": ["<C-w>", "j"]
},
{
"before": ["<C-k>"],
"after": ["<C-w>", "k"]
},
{
"before": ["<C-l>"],
"after": ["<C-w>", "l"]
},
{
"before": ["H"],
"after": [ "0"]
},
{
"before": [ "L" ],
"after": [ "$" ]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment