Skip to content

Commit

Permalink
Change dots command and also telescope for dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
DevonMorris committed Jan 21, 2023
1 parent b999338 commit 7ba9c14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
2 changes: 0 additions & 2 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ source "$HOME/.shell.d/node.sh"

# Work related config
[ -f $HOME/.shell.d/work.sh ] && source "$HOME/.shell.d/work.sh"
. "$HOME/.cargo/env"

26 changes: 3 additions & 23 deletions .config/nvim/lua/devo/telescope.lua
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
2 changes: 1 addition & 1 deletion scripts/dots
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 "$@"

0 comments on commit 7ba9c14

Please sign in to comment.