This commit is contained in:
pvincent
2026-08-06 18:12:25 +04:00
parent 4907f581cc
commit 556fad02df
14 changed files with 176 additions and 423 deletions
+6
View File
@@ -0,0 +1,6 @@
" AZERTY quick access to basic keys
" ---------------------------------
nnoremap ! .
nnoremap à 0
nnoremap ù %
+40
View File
@@ -0,0 +1,40 @@
" Smart Defaults
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
set shiftwidth=2
set tabstop=2
set expandtab
set number
set relativenumber
filetype plugin indent on
" Show Status
set laststatus=2
highlight StatusLine ctermfg=DarkGrey
" Wild Menu
set wildmenu
set wildmode=list:longest
set wildignore=*.jpg,*.png,*.gif,*.pdf
" Show Cursor
set cursorline
highlight clear CursorLine
highlight link CursorLine CursorColumn
highlight CursorLineNR cterm=italic
" Toggle line/relative numbers
nnoremap <F2> :set number!<CR>
nnoremap <F3> :set relativenumber!<CR>
highlight LineNr ctermfg=DarkGrey
" Sudo Write
command! W silent execute 'write !sudo tee ' . shellescape(@%, 1) . ' >/dev/null'
" Jump to Last Position
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
+8
View File
@@ -0,0 +1,8 @@
let additionals = [ "core", "miaou", "rookie", "azerty" ]
for additional in additionals
let s:vimrc_path = "/etc/vim/vimrc." . additional
if filereadable(s:vimrc_path)
execute "source " . expand(s:vimrc_path)
endif
endfor
+3
View File
@@ -0,0 +1,3 @@
" Detect miaou-bash
autocmd BufReadPost,BufNewFile * if getline(1) =~# '^#!.*miaou-bash' | setlocal filetype=bash | endif
+80
View File
@@ -0,0 +1,80 @@
" ROOKIE vim user
" ---------------
" Open File and Go to Line under Cursor
nnoremap gf gF
" Move Along Words
inoremap <C-Left> B
inoremap <C-Right> W
inoremap <M-Left> b
inoremap <M-Right> w
nnoremap <M-Left> b
nnoremap <M-Right> w
" Move Along Paragraphs
inoremap <C-Up> {
inoremap <C-Down> }
nnoremap <C-Up> {
nnoremap <C-Down> }
" Delete Words
inoremap <C-BS> db
inoremap <M-BS> d0
inoremap <C-Del> dw
inoremap <M-Del> d$
nnoremap <C-BS> db
nnoremap <M-BS> d0
nnoremap <C-Del> dw
nnoremap <M-Del> d$
" Select
nnoremap <S-Left> vh
inoremap <S-Left> <Esc>vh
nnoremap <S-Right> vl
inoremap <S-Right> <Esc>vl
nnoremap <S-Up> vk
vnoremap <S-Up> k
inoremap <S-Up> <Esc>vk
nnoremap <S-Down> vj
vnoremap <S-Down> j
inoremap <S-Down> <Esc>vj
inoremap <S-Home> <Esc>v^
inoremap <S-Home> <Esc>v^
nnoremap <S-End> v$
inoremap <S-End> <Esc>v^
" Save
nnoremap <C-s> :w<CR>
inoremap <C-s> <Esc>:w<CR>a
vnoremap <C-s> <Esc>:w<CR>
" Quit
nnoremap <C-q> :qa<CR>
inoremap <C-q> <Esc>:qa<CR>
" Slower Scroll Page
nnoremap <PageDown> <C-d><C-d>
nnoremap <PageUp> <C-u><C-u>
vnoremap <PageDown> <C-d>
vnoremap <PageUp> <C-u>
inoremap <PageDown> <C-o><C-d><C-o><C-d>
inoremap <PageUp> <C-o><C-u><C-o><C-u>
" Slower Scroll Wheel
nnoremap <ScrollWheelUp> <C-u>
nnoremap <ScrollWheelDown> <C-d>
vnoremap <ScrollWheelUp> k
vnoremap <ScrollWheelDown> j
inoremap <ScrollWheelUp> <C-o><C-u>
inoremap <ScrollWheelDown> <C-o><C-d>
" Move Lines
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv