• STATISTIQUES
  • Il y a eu un total de 1 membres et 3444 visiteurs sur le site dans les dernières 24h pour un total de 3 445 personnes!


    Membres: 2 450
    Discussions: 3 572
    Messages: 32 822
    Tutoriels: 77
    Téléchargements: 38
    Sites dans l'annuaire: 58


  • ANNUAIRE
  • [FR] dcode
    dcode.fr est le site indispensable pour décoder des messages, tricher aux jeux de lettres, résoudre des énigmes...
    Outils / Add-on
    [EN] Listbrain Version 3
    Site proposant 66 challenges présentés dans une liste mélangée.
    Challenges
    [EN] Big-Daddy
    Big-Daddy est site internet communautaire avec un effectif diversifié, y compris des artistes, des programmeur...
    Hacking
    [FR] µContest
    µContest est un site de challenges de programmation, c'est à dire qu'il propose des épreu...
    Hacking
    [EN] phrack
    Lot's of stuff !
    Hacking
    [FR] Comment ca marche
     Gratuit et accessible à tous, ce site de communauté permet de se dépanner, se faire aider ...
    Webmaster
    [FR] InfoMirmo
    Apprentissage de l'informatique par l'intermédiaire de challenges de sécurité. Venez app...
    Hacking

  • DONATION
  • Si vous avez trouvé ce site internet utile, nous vous invitons à nous faire un don du montant de votre choix via Paypal. Ce don servira à financer notre hébergement.

    MERCI!




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Caverne des vims
16-02-2016, 11h27 (Modification du message : 16-02-2016, 11h29 par Dobry.)
Message : #1
Dobry Hors ligne
Tueur de lamouz
*



Messages : 206
Sujets : 25
Points: 73
Inscription : Aug 2011
Caverne des vims
Après une petite discussion sur IRC ce matin, je me suis dit que ca pourrait être sympa de regrouper les différents configuration de chacun pour VIM.
L'idée de base est de faire découvrir des plugins intéressants ou des configs pour VIM.

Hésitez pas à partager les plugins que vous utilisez !

Mon vimrc

Code :
set nocompatible               " be iMproved
set hidden
filetype off                   " required!
execute pathogen#infect()

filetype plugin indent on
filetype plugin on
syntax on
set encoding=utf-8
set number
let mapleader=","

map <S-Right> :bnext<CR>
map <S-Left> :bprev<CR>
imap <S-Right> <Esc>:bnext<CR>
imap <S-Left> <Esc>:bprev<CR>

set whichwrap+=[
let mapleader = ","

set tabstop=4
set softtabstop=4
set expandtab
set showcmd
set cursorline
set wildmenu
set showmatch

set incsearch
set hlsearch

" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_c_compiler_options = ' -std=c11'
let g:syntastic_python_python_exec = '/usr/bin/python2.7'

" SingleCompile
autocmd Filetype c map <C-B> :SCCompileRunAF -std=c11 -Wall<CR>
autocmd Filetype c imap <C-B> :SCCompileRunAF -std=c11 <CR>
nmap <F9> :SCCompileRun<cr>

" Move line
inoremap <C-j> <Esc>:m .+1<CR>==gi
inoremap <C-k> <Esc>:m .-2<CR>==gi
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv

" Move window
nnoremap <C-S-k> :wincmd k<CR>
nnoremap <C-S-j> :wincmd j<CR>
nnoremap <C-S-h> :wincmd h<CR>
nnoremap <C-S-l> :wincmd l<CR>

" When a line is cut, moving will jump over the second part
nnoremap j gj
nnoremap k gk
nnoremap gV `[v`]
" Airline buffer

" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'

" Markdown
let g:instant_markdown_slow = 1
let g:instant_markdown_autostart = 0

set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256

set nofoldenable
set foldmethod=indent  
set foldnestmax=10
set foldlevel=2

" CtrlP settings
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'


augroup configgroup
    autocmd!
    autocmd VimEnter * highlight clear SignColumn
    autocmd FileType java setlocal noexpandtab
    autocmd FileType java setlocal list
    autocmd FileType java setlocal listchars=tab:+\ ,eol:-
    autocmd FileType java setlocal formatprg=par\ -w80\ -T4
    autocmd FileType php setlocal expandtab
    autocmd FileType php setlocal list
    autocmd FileType php setlocal listchars=tab:+\ ,eol:-
    autocmd FileType php setlocal formatprg=par\ -w80\ -T4
    autocmd FileType ruby setlocal tabstop=2
    autocmd FileType ruby setlocal shiftwidth=2
    autocmd FileType ruby setlocal softtabstop=2
    autocmd FileType ruby setlocal commentstring=#\ %s
    autocmd FileType python setlocal commentstring=#\ %s
    autocmd FileType js set tabstop=2|set shiftwidth=2|set expandtab
    autocmd FileType ruby set tabstop=2|set shiftwidth=2|set expandtab
    autocmd Filetype javascript,scala setlocal ts=2 sts=2 sw=2
    autocmd FileType lua set tabstop=4|set shiftwidth=2|set expandtab
    autocmd Filetype c set tabstop=4|set shiftwidth=4|set expandtab
    autocmd Filetype c,cpp TlistOpen

    autocmd BufEnter *.cls setlocal filetype=java
    autocmd BufEnter *.zsh-theme setlocal filetype=zsh
    autocmd BufEnter Makefile setlocal noexpandtab
    autocmd BufEnter *.sh setlocal tabstop=2
    autocmd BufEnter *.sh setlocal shiftwidth=2
    autocmd BufEnter *.sh setlocal softtabstop=2

augroup END

" Change the location of the vim backup file (when crash)
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup

" Markdown
let g:vim_markdown_math=1
Aestuārium Erudītiōnis

There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors.
+1 (3) -1 (0) Répondre
16-02-2016, 13h32
Message : #2
otherflow Hors ligne
Newbie
*



Messages : 20
Sujets : 2
Points: 18
Inscription : Aug 2014
RE: Caverne des vims
Salut Dobry

Merci de l'initiative, VIM est décrit comme un éditeur très puissant et qui offre pas mal de possibilités de personnalisation. Pour ma part je connais VIM que de nom et je suis donc heureux d'apprendre à ce sujet.

En espérant que d'autres membres répondent a ton initiatives en complétant cette liste.

otherflow
+1 (0) -1 (0) Répondre
16-02-2016, 15h31
Message : #3
supersnail Hors ligne
Éleveur d'ornithorynques
*******



Messages : 1,617
Sujets : 73
Points: 467
Inscription : Jan 2012
RE: Caverne des vims
Bizarre qu'il ait pas été mentionné encore, mais il ne faut pas oublier l'immense et indispensable NERDTree, qui est utile pour gérer des gros projets notamment.

Après dans le désordre:
  • python-mode pour les pythonneux avec vérification de syntaxe/complétion et PyLint/vérificateur PEP8, plus poussé que syntastic
  • vim-airline pour avoir une jolie barre de statut dans vim, avec des infos utiles (branche GIT actuelle, etc).
  • fugitive, un wrapper de commandes git pour vim
Mon blog

Code :
push esp ; dec eax ; inc ebp ; and [edi+0x41],al ; dec ebp ; inc ebp

"VIM est merveilleux" © supersnail
+1 (1) -1 (0) Répondre
20-02-2016, 02h12
Message : #4
lanodan Hors ligne
gentooiste (ex debianeux)
*



Messages : 10
Sujets : 1
Points: -3
Inscription : Feb 2014
RE: Caverne des vims
Plugin : NeoComplete.vim (Complétion de syntaxe, variables, fichiers, mots, …)

~/.vimrc
Code :
"ilet loaded_matchparen = 1
let g:neocomplete#enable_at_startup = 1

filetype indent plugin off " KISS and no PEP8

set nobomb
set encoding=utf-8
"set uc=0
set noautoindent nosmartindent
set hlsearch

set tabpagemax=16
set foldmethod=indent
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab " I’d prefer plain \t

syntax on
set bg=dark
colorscheme solarized

noremap <F8> :call HexMe()<CR>
let $in_hex=0

function HexMe()
    set binary
    if $in_hex>0
        :%!xxd -r
        let $in_hex=0
    else
        :%!xxd
        let $in_hex=1
    endif
endfunction

" Transparent editing of gpg encrypted files.
" By Wouter Hanegraaff
augroup encrypted
    au!

    " First make sure nothing is written to ~/.viminfo while editing
    " an encrypted file.
    autocmd BufReadPre,FileReadPre *.gpg set viminfo=
    " We don’t want a various options which write unencrypted data to disk
    autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup

    " Switch to binary mode to read the encrypted file
    autocmd BufReadPre,FileReadPre *.gpg set bin
    autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
    " (If you use tcsh, you may need to alter this line.)
    autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null

    " Switch to normal mode for editing
    autocmd BufReadPost,FileReadPost *.gpg set nobin
    autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save
    autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r")

    " Convert all text to encrypted text before writing
    " (If you use tcsh, you may need to alter this line.)
    autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null
    " Undo the encryption so we are back in the normal text, directly
    " after the file has been written.
    autocmd BufWritePost,FileWritePost *.gpg u
augroup END

set statusline=%<%F\ [%{&ff}][%{&enc}%{((exists(\"+bomb\")\ &&\ &bomb)?\",\ BOM\":\"\")}]\ %=\ %-14.(%l,%c%V%)\ %P
set laststatus=2
+1 (0) -1 (0) Répondre
22-02-2016, 11h33
Message : #5
Junky Hors ligne
Snorky Master
*



Messages : 228
Sujets : 35
Points: 204
Inscription : Mar 2013
RE: Caverne des vims
Bonjour,

Voilà une éternité que je n'ai plus posté. Voici mes conf VIM:

Code BASH :

" ------------------------------------------------------
"
-------------------Basic config-----------------------
" ------------------------------------------------------
"
{{{
set nocompatible
syntax on
colorscheme darkblue
set number
set tabstop=2
set cursorline
highlight CursorLine   cterm=bold ctermbg=blue ctermfg=234
set foldmethod=marker
" }}}

"
------------------------------------------------------
"-------------------NERDTree config---------------------
"
-------------------------------------------------------
" {{{
execute pathogen#infect()
autocmd StdinReadPre * let s<img src="
https://n-pn.fr/forum/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />td_in=1
autocmd VimEnter * if argc() == 0 && !exists("
s<img src="https://n-pn.fr/forum/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />td_in") | NERDTree | endif
"
}}}

" ------------------------------------------------------
"
-----------------Conf for vim wiki--------------------
" ------------------------------------------------------
"
{{{
map <C-n> :NERDTreeToggle<CR>
let mapleader = ","
let maplocalleader = ","
filetype plugin indent on
" }}}

"
------------------------------------------------------
" ----------------ConqueTerm config---------------------
"
------------------------------------------------------
" {{{
let g:ConqueTerm_EscKey = '<C-k>'
let g:ConqueTerm_FastMode = 1
let g:ConqueTerm_CloseOnEnd = 0
let g:ConqueTerm_InsertOnEnter = 0
let g:ConqueTerm_PromptRegex = '^\w\+@[0-9A-Za-z_.-]\+:[0-9A-Za-z_./\~,:-]\+\$'
let g:ConqueTerm_Syntax = 'conque'
"
}}}

" ------------------------------------------------------
"
--------------Enable Ctrl + C in vim------------------
" ------------------------------------------------------
"
{{{
vnoremap <C-c> "+y
"
}}}

" ------------------------------------------------------
"
----------------------TAB conf------------------------
" ------------------------------------------------------
"
{{{
set tabline=%!MyTabLine()  " custom tab pages line
function MyTabLine()
        let s = '' "
complete tabline goes here
        " loop through each tab page
        for t in range(tabpagenr('$'))
                "
set highlight
                if t + 1 == tabpagenr()
                        let s .= '%#TabLineSel#'
                else
                        let s .= '%#TabLine#'
                endif
                " set the tab page number (for mouse clicks)
                let s .= '%' . (t + 1) . 'T'
                let s .= ' '
                "
set page number string
                let s .= t + 1 . ' '
                " get buffer names and statuses
                let n = ''      "
temp string for buffer names while we loop and check buftype
                let m = 0       " &modified counter
                let bc = len(tabpagebuflist(t + 1))     "
counter to avoid last ' '
                " loop through each buffer in a tab
                for b in tabpagebuflist(t + 1)
                        "
buffer types: quickfix gets a [Q], help gets [H]{base fname}
                        " others get 1dir/2dir/3dir/fname shortened to 1/2/3/fname
                        if getbufvar( b, "
&buftype" ) == 'help'
                                let n .= '[H]' . fnamemodify( bufname(b), ':t<img src="
https://n-pn.fr/forum/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />/.txt$//' )
                        elseif getbufvar( b, "
&buftype" ) == 'quickfix'
                                let n .= '[Q]'
                        else
                                let n .= pathshorten(bufname(b))
                        endif
                        "
check and ++ tab's &modified count
                        if getbufvar( b, "&modified" )
                                let m += 1
                        endif
                        " no final '
' added...formatting looks better done later
                        if bc > 1
                                let n .= '
'
                        endif
                        let bc -= 1
                endfor
                " add modified label [n+] where n pages in tab are modified
                if m > 0
                        let s .= '
[' . m . '+]'
                endif
                " select the highlighting for the buffer names
                " my default highlighting only underlines the active tab
                " buffer names.
                if t + 1 == tabpagenr()
                        let s .= '
%#TabLineSel#'
                else
                        let s .= '%#TabLine#'
                endif
                " add buffer names
                if n == ''
                        let s.= '[New]'
                else
                        let s .= n
                endif
                "
switch to no underlining and add final space to buffer list
                let s .= ' '
        endfor
        " after the last tab fill with TabLineFill and reset tab page nr
        let s .= '%#TabLineFill#%T'
        "
right-align the label to close the current tab page
        if tabpagenr('$') > 1
                let s .= '%=%#TabLineFill#%999Xclose'
        endif
        return s
endfunction
" }}}

Pour la sécurité, sous linux, le principal soucis est l'interface chaise/clavier

+1 (1) -1 (0) Répondre
26-02-2016, 11h37
Message : #6
M4z3N Hors ligne
Membre
*



Messages : 36
Sujets : 1
Points: 2
Inscription : Jul 2013
RE: Caverne des vims
Salut, rien de bien spécial j'ai découvert vim il y a un petit moment mais je sens que je ne l'utilise pas à son maximum et qu'il a encore des tas de choses à me faire découvrir

Code :
"Pathogen + Gotham colorscheme

execute pathogen#infect()
syntax on
filetype plugin indent on
colorscheme gotham

hi Normal             ctermbg=NONE
hi Statement          ctermbg=NONE
hi Title              ctermbg=NONE
hi Todo               ctermbg=NONE
hi Underlined         ctermbg=NONE
hi ErrorMsg           ctermbg=NONE
hi LineNr             ctermbg=NONE

command S2 set tabstop=2 shiftwidth=2 noexpandtab
command S4 set tabstop=4 shiftwidth=4 noexpandtab
command T2 set tabstop=2 shiftwidth=2 expandtab
command T4 set tabstop=4 shiftwidth=4 expandtab

" requis python-powerline-git package
let $PYTHONPATH='/usr/lib/python3.4/site-packages'
Stay Zen
+1 (0) -1 (0) Répondre


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
N-PN
Accueil | Challenges | Tutoriels | Téléchargements | Forum | Retourner en haut