Coder Social home page Coder Social logo

defx-git's Introduction

defx-git

Git status implementation for defx.nvim.

Usage

Just append git to your columns when starting defx:

:Defx -columns=git:mark:filename:type

Options

g:defx_git#indicators

Which indicators (icons) to use for each status. These are the defaults:

let g:defx_git#indicators = {
  \ 'Modified'  : '',
  \ 'Staged'    : '',
  \ 'Untracked' : '',
  \ 'Renamed'   : '',
  \ 'Unmerged'  : '',
  \ 'Ignored'   : '',
  \ 'Deleted'   : '',
  \ 'Unknown'   : '?'
  \ })

g:defx_git#column_length

How many space should git column take. Default is 1 (Defx adds a single space between columns):

let g:defx_git#column_length = 1

Missing characters to match this length are populated with spaces, which means becomes , etc.

Note: Make sure indicators are not longer than the column_length

g:defx_git#show_ignored

This flag determines if ignored files should be marked with indicator. Default is false:

let g:defx_git#show_ignored = 0

g:defx_git#raw_mode

Show git status in raw mode (Same as first two chars of git status --porcelain command). Default is 0:

let g:defx_git#raw_mode = 1

Highlighting

Each indicator type can be overridden with the custom highlight. These are the defaults:

hi Defx_git_Untracked guibg=NONE guifg=NONE ctermbg=NONE ctermfg=NONE
hi Defx_git_Ignored guibg=NONE guifg=NONE ctermbg=NONE ctermfg=NONE
hi Defx_git_Unknown guibg=NONE guifg=NONE ctermbg=NONE ctermfg=NONE
hi Defx_git_Renamed ctermfg=214 guifg=#fabd2f
hi Defx_git_Modified ctermfg=214 guifg=#fabd2f
hi Defx_git_Unmerged ctermfg=167 guifg=#fb4934
hi Defx_git_Deleted ctermfg=167 guifg=#fb4934
hi Defx_git_Staged ctermfg=142 guifg=#b8bb26

To use for example red for untracked files, add this after your colorscheme setup:

colorscheme gruvbox
hi Defx_git_Untracked guifg=#FF0000

Mappings

There are two mappings:

  • <Plug>(defx-git-next) - Goes to the next file that has a git status
  • <Plug>(defx-git-prev) - Goes to the prev file that has a git status

If these are not manually mapped by the user, defaults are:

nnoremap <buffer><silent> [c <Plug>(defx-git-prev)
nnoremap <buffer><silent> ]c <Plug>(defx-git-next)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.