• unrealapex
    link
    fedilink
    arrow-up
    1
    ·
    6 days ago

    I can’t live without these options:

    set background=dark
    set belloff=all
    set complete-=i
    set completeopt=menu,menuone,noselect
    set cursorline
    set hidden
    set hlsearch
    set incsearch
    set number
    set omnifunc=syntaxcomplete#Complete
    set path+=.,,
    set pumheight=12
    set relativenumber
    set showmode
    set wildmenu
    set wildmode=longest:full,full
    set wildoptions=pum,tagfile
    

    Use gx to open URLS or paths without Netrw :D

    nnoremap gx :silent !xdg-open <cfile><CR>
    

    Keep visual selection when shifting text

    xnoremap < <gv
    xnoremap > >gv
    

    I use buffers more than tabs but these tab keymaps are convenient

    nnoremap <leader>1 1gt<cr>
    nnoremap <leader>2 2gt<cr>
    nnoremap <leader>3 3gt<cr>
    nnoremap <leader>4 4gt<cr>
    nnoremap <leader>5 5gt<cr>
    nnoremap <leader>6 6gt<cr>
    nnoremap <leader>7 7gt<cr>
    nnoremap <leader>8 8gt<cr>
    nnoremap <leader>9 9gt<cr>
    nnoremap <leader>t :tabnew<cr>
    nnoremap <leader>x :tabclose<cr>
    

    Use fzy to pick files :O

    function! FzyCommand(choice_command, vim_command)
      try
        let output = system(a:choice_command . " | fzy ")
      catch /Vim:Interrupt/
        " Swallow errors from ^C, allow redraw! below
      endtry
      redraw!
      if v:shell_error == 0 && !empty(output)
        exec a:vim_command . ' ' . output
      endif
    endfunction
    
    nnoremap <leader>ff :call FzyCommand("fd", ":e")<cr>
    

    My favorite plugins

    • comment (comment package bundled with vim)
    • vim-gitgutter (Git gutter markings and diff navigation)
    • vim-mucomplete (automatic omnicompletion )
    • vim-repeat (repeating actions)
    • vim-surround (easily surrounding text)
    • vim-unimpaired (several useful mappings, I use [<space> and ]<space> often to add lines)
  • Vorthas
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 year ago

    I always like to remap Y to yank from current position to end of line, so it works just like D.

    nnoremap Y y$

  • haiOP
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    1 year ago

    I’ll go first: For me incrementing search is a must-have.

    Vim script:

    set incsearch
    

    Lua:

    vim.opt.incsearch = true
    

    Edit: Typo

    • wvstolzing
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      That was a typo though, wasn’t it? Bcs I’m not ruling out the possibility that there’s an FBI plugin for neovim nowadays.

      • haiOP
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Ha! Good catch, that’s my bad. Thanks btw.

  • Ladas552
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 year ago

    Default line wraping with this options:

    opt.linebreak = true

    opt.breakindent = true

    Makes writing and reading notes a lot better. Don’t know about coding tho, some people don’t like it but for me it’s a killer feature.

  • russjr08@outpost.zeuslink.net
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    1 year ago

    I quite like the relativenumber option (paired with the number option), because I’m terrible at being able to use numbered motions without it.

    I’m not sure what my favorite plugin would be (so many to choose from!), but my favorite Neovim color scheme has been “GitHub Dark Tritanopia” from the github-nvim-theme package.

    Oh, and for another favorite tweak of mine, I always have vnoremap $ g_ set so that using $ doesn’t copy the new line character.

  • sbv@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I use vim as a log viewer. First thing I do is copy my homemade syntax files onto the host. chefskiss.gif

  • collapse_already
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Pretty basic, but I like setting backupdir and directory so I don’t have to add vim undo and swap files to my .gitignore. Also, noerrorbells because sounds irritate me and I frequently intentionally do things that would trigger them.