" File : keybindings.vim " Author : Jeff LANCE " Date : 15.04.2015 " Last Modified Date: 22.07.2022 " Last Modified By : Jeff LANCE """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " _ _________ ______ ___ _ _ ____ ___ _ _ ____ ____ " | |/ / ____\ \ / / __ )_ _| \ | | _ \_ _| \ | |/ ___/ ___| " | ' /| _| \ V /| _ \| || \| | | | | || \| | | _\___ \ " | . \| |___ | | | |_) | || |\ | |_| | || |\ | |_| |___) | " |_|\_\_____| |_| |____/___|_| \_|____/___|_| \_|\____|____/ " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Custom {{{ " ----- " Disable highlights when you press : map :noh " Enable folding with the spacebar nnoremap za " Source current file map s :echom 'Source file' :so % " Two semicolons to escape map ; map! ; " Open a current file with sudo " map E :e suda://% " Save a current file with sudo " map W :w suda://% " Comment the target of a motion map / :Commentary " Indent line map >> map << " (Re|Un)do map uu " Save as map :saveas " ----- " }}} " Buffers {{{ " ----- " command! -bang -nargs=? -complete=dir Files " \ call fzf#vim#files( " \ , " \ fzf#vim#with_preview( " \ {'options': ['--layout=reverse', '--info=inline']} " \ ), " \ 0 " \ ) command -bang CloseBuffer :call CloseBuffer() map ff lua require('telescope.builtin').find_files() map fd lua require('telescope.builtin').find_files({ cwd = '/home/jeff/dotfiles' }) map fh lua require('telescope.builtin').oldfiles() map cn :echom 'Nouveau fichier' :DashboardNewFile map :e map :echom 'Fermeture fichier' :CloseBuffer! map :bn map :bp " ----- " }}} " Windows {{{ " ----- map :call WinMove('h') map :call WinMove('j') map :call WinMove('k') map :call WinMove('l') " ----- " }}} " Dashboard {{{ " ----- nmap ss :SessionSave nmap sl :SessionLoad " ----- " }}} " ----- " }}} " Header {{{ " ----- map :AddHeader " ----- " }}} " Markdown {{{ " ----- map mp :! pandoc "%" -o "%:r".pdf && zathura "%:r".pdf " ----- " }}} " Vimroom {{{ " ----- nnoremap z :Goyo " ----- " }}} " Vimux {{{ " ----- map vp :VimuxPromptCommand " map vr :VimuxRunCommand " map vo :VimuxOpenRunner " ----- " }}} " Functions {{{ " ----- " Renaming map fr :call RenameFile() " Open file under cursor map foc :call GotoFile("") " Surround map ' S' map " S" map [ S[ map { S{ map ( S( " " Rewrap paragraph using " map {gq}:echo "Rewrapped paragraph" " Git map Gs :Git status map Ga :Git add map Gc :Git commit " ----- " }}} " vim:ft=vim