kristijanhusak / defx-git Goto Github PK
View Code? Open in Web Editor NEWGit status implementation for https://github.com/Shougo/defx.nvim
License: MIT License
Git status implementation for https://github.com/Shougo/defx.nvim
License: MIT License
One of the things I missed the most form nerdtrees-git-status plugin was the ability to highlight files based on their status.
If a file is part of gitignored, it can be grayed out, if there's a new file, it can be colored yellow, and modified files can be cyan.
Any thoughts on modifying the filename column from defx add this? I can try to make a PR if you are interested.
a folder have one file, a.vim
,
after copy, paste, a.vim already exists. Overwrite? rename to a2.vim
after copy, paste, a.vim already exists. Overwrite? rename to a.vim2
a.vim
never change, why have status?
'columns': 'icons:indent:filename:git:type'
call defx#custom#column('git', 'indicators', {
\ 'Modified' : 'M',
\ 'Staged' : '+',
\ 'Untracked' : 'N',
\ 'Renamed' : 'โ',
\ 'Unmerged' : 'โ',
\ 'Ignored' : 'โ',
\ 'Deleted' : 'โ',
\ 'Unknown' : '?'
\ })
> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
a.vim2
nothing added to commit but untracked files present (use "git add" to track)
Hi there! Looks like there's an error that happens when you delete some files in git.
Error detected while processing function defx#_do_action[6]..defx#util#rpcrequest[15].._defx_do_action[1]..remote#define#request:
line 2:
error caught in request handler '/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx:function:_defx_do_action [['drop', [], {'columns': 'mark:filename:typ
e', 'auto_cd': False, 'prev_bufnr': 2, 'resume': False, 'listed': False, 'new': False, 'fnamewidth': 100, 'direction': '', 'winheight': 0, 'profile': False, 's
earch': '', 'buffer_name': 'default', 'winwidth': 0, 'split': 'no', 'cursor': 7, 'toggle': False}]]':
Traceback (most recent call last):
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/__init__.py", line 41, in do_action
self._rplugin.do_action(args)
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/rplugin.py", line 37, in do_action
view.do_action(args[0], args[1], args[2])
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/view.py", line 324, in do_action
ret = action.do_action(self, defx, action_name, context)
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/action.py", line 38, in do_action
action.func(view, defx, context)
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/action.py", line 236, in _drop
view.cd(defx, str(path), context.cursor)
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/view.py", line 281, in cd
self.redraw(True)
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/view.py", line 235, in redraw
for x in self._candidates
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/view.py", line 235, in <listcomp>
for x in self._candidates
File "/Users/mhartington/GitHub/defx.nvim/rplugin/python3/defx/view.py", line 251, in get_columns_text
text += column.get(context, candidate)
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/defx/column/git.py", line 52, in get
self.indicators[self.get_indicator_name(entry[0], entry[1])]
KeyError: 'Deleted'
Will look into this, but figured I'd pass it along.
Cheers!
In the README file ,highlight is config like :
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
But when I used it , highlight does not work I have to change the config file to :
hi Defx_git_0_Untracked ctermfg=12 guifg=#81a2be
hi Defx_git_0_Ignored ctermfg=8 guifg=#404660
hi Defx_git_0_Unknown ctermfg=3 guifg=#f0c674
hi Defx_git_0_Renamed ctermfg=3 guifg=#de935f
hi Defx_git_0_Modified ctermfg=9 guifg=#cc6666
hi Defx_git_0_Unmerged ctermfg=14 guifg=#8abeb7
hi Defx_git_0_Deleted ctermfg=13 guifg=#b294bb
hi Defx_git_0_Staged ctermfg=10 guifg=#b5bd68
Don't know why.
:Defx command produces blank buffer on first try, works on second try
VIMRC
call plug#begin('~/.vim/bundle') "plugins' root path
Plug 'Shougo/defx.nvim'
Plug 'kristijanhusak/defx-icons'
Plug 'kristijanhusak/defx-git'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
" All of your Plugs must be added before the following line
call plug#end() " required
It's mean can i show the head two column of git status --short --porcelain
.
Hi @kristijanhusak , thanks for this plugin! But I found if the file name has space git status will not show before it.
sorry I thought wrong... please delete this
After I install defx-git when I write buffer with defx shows get error: [defx] Vim(call):E964: Invalid column number: 4
.
If I disable defx-git, not error report when writing file buffer.
my relate setting is:
silent! call defx#custom#option('_', {
\ 'winwidth': 25,
\ 'split': 'vertical',
\ 'direction': 'topleft',
\ 'show_ignored_files': 0,
\ 'buffer_name': 'defxplorer',
\ 'columns': 'indent:git:icons:filename',
\ 'toggle': 1,
\ 'resume': 1,
\ 'listed': 1,
\ 'root_marker': 'โก '
\ })
Is there anything wrong with my setting?
If user don't set these group will be broken, So should be add a default link
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
defx-git and vim-fugitive appear to be colliding with one another on the index file. I've created an issue with fugitive as well.
Error detected while processing BufReadCmd Autocommands for "index{,.lock}":
fugitive: sh /s: No such file or directory
Hi, @kristijanhusak <Plug>(defx-git-prev)
not work well when setting let g:defx_git#raw_mode = 1
.
As code below:
Line 17 in 319dd3b
set pattern for not raw mode.
Like I have an untracked file and ??
will show on defx, if I run <Plug>(defx-git-next)
cursor will on the sencond ?
not the next file that has a stutas.
Originally posted by @roachsinai in #3 (comment)
Similar to Xuyuanp/nerdtree-git-plugin#106 I think
Hi @kristijanhusak exists
below return 0 on my PC:
Line 1 in 324552f
change it to exists("*defx#redraw()")
returns 1.
Or maybe I need extra settings?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.