-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change dots command and also telescope for dotfiles
- Loading branch information
1 parent
b999338
commit 7ba9c14
Showing
3 changed files
with
4 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,11 @@ | ||
local pickers = require('telescope.pickers') | ||
local finders = require('telescope.finders') | ||
local make_entry = require('telescope.make_entry') | ||
local previewers = require('telescope.previewers') | ||
local conf = require('telescope.config').values | ||
|
||
local telescope = require'telescope.builtin' | ||
M = {} | ||
|
||
M.find_dots = function(opts) | ||
opts = opts or {} | ||
|
||
opts.cwd = os.getenv("HOME") | ||
-- By creating the entry maker after the cwd options, | ||
-- we ensure the maker uses the cwd options when being created. | ||
opts.entry_maker = opts.entry_maker or make_entry.gen_from_file(opts) | ||
|
||
pickers.new(opts, { | ||
prompt_title = '~~ Dotfiles ~~', | ||
finder = finders.new_oneshot_job( | ||
{ "git", | ||
"--git-dir="..os.getenv("HOME").."/.dots/", | ||
"--work-tree="..os.getenv("HOME"), | ||
"ls-tree", "--full-tree", "-r", "--name-only", "HEAD"}, | ||
opts | ||
), | ||
previewer = previewers.vim_buffer_cat.new(opts), | ||
sorter = conf.file_sorter(opts), | ||
}):find() | ||
opts.cwd = os.getenv("HOME").."/.dots" | ||
telescope.git_files(opts) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
/usr/bin/env git --git-dir=$HOME/.dots/ --work-tree=$HOME "$@" | ||
/usr/bin/env git --git-dir=$HOME/.dots/.git --work-tree=$HOME/.dots "$@" |