Merge pull request #64 from ecosse3/feature/filter-current-file-cmd
feat: add LazyGitFilterCurrentFile command
This commit is contained in:
12
README.md
12
README.md
@@ -55,6 +55,18 @@ If the file does not exist it'll load the defaults for you.
|
||||
|
||||

|
||||
|
||||
Open project commits with `lazygit` directly from vim in floating window.
|
||||
|
||||
```vim
|
||||
:LazyGitFilter<CR>
|
||||
```
|
||||
|
||||
Open buffer commits with `lazygit` directly from vim in floating window.
|
||||
|
||||
```vim
|
||||
:LazyGitFilterCurrentFile<CR>
|
||||
```
|
||||
|
||||
**Using neovim-remote**
|
||||
|
||||
If you have [neovim-remote](https://github.com/mhinz/neovim-remote) and have configured to use it in neovim, it'll launch the commit editor inside your neovim instance when you use `C` inside `lazygit`.
|
||||
|
||||
@@ -82,6 +82,12 @@ local function lazygitfilter(path)
|
||||
exec_lazygit_command(cmd)
|
||||
end
|
||||
|
||||
--- :LazyGitFilterCurrentFile entry point
|
||||
local function lazygitfiltercurrentfile()
|
||||
local current_file = vim.fn.expand('%')
|
||||
lazygitfilter(current_file)
|
||||
end
|
||||
|
||||
--- :LazyGitConfig entry point
|
||||
local function lazygitconfig()
|
||||
local os = fn.substitute(fn.system('uname'), '\n', '', '')
|
||||
@@ -115,6 +121,7 @@ end
|
||||
return {
|
||||
lazygit = lazygit,
|
||||
lazygitfilter = lazygitfilter,
|
||||
lazygitfiltercurrentfile = lazygitfiltercurrentfile,
|
||||
lazygitconfig = lazygitconfig,
|
||||
project_root_dir = project_root_dir,
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ command! LazyGit lua require'lazygit'.lazygit()
|
||||
|
||||
command! LazyGitFilter lua require'lazygit'.lazygitfilter()
|
||||
|
||||
command! LazyGitFilterCurrentFile lua require'lazygit'.lazygitfiltercurrentfile()
|
||||
|
||||
command! LazyGitConfig lua require'lazygit'.lazygitconfig()
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
Reference in New Issue
Block a user