Skip to content

Commit

Permalink
Revert ":new:(nvim) adds new vimwiki <leader>ws with telescope"
Browse files Browse the repository at this point in the history
This reverts commit 9e61da6.
  • Loading branch information
neninja committed Sep 13, 2023
1 parent 9e61da6 commit 173c219
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion nvim/lua/my/pack/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local my_items = {
{ name = 'Blog WTF', action = 'e ' .. "~/dev/blog/wtf/README.md" .. ' | call NN_SetGitDir()', section = '' },
{ name = 'Snippets blog', action = 'e ' .. "~/dev/blog/blog_snippets/README.md" .. ' | call NN_SetGitDir()', section = '' },
{ name = 'Plugin sync', action = 'PackerSync', section = '' },
{ name = 'Wikis', action = 'VimwikiNewUISelect', section = '' },
{ name = 'Wikis', action = 'VimwikiUISelect', section = '' },
{ name = 'Organização pessoal', action = 'VimwikiIndex 1', section = '' },
{ name = 'Git status', action = 'Gedit :', section = 'Projeto' },
{ name = 'Find files', action = 'Telescope find_files', section = 'Projeto' },
Expand Down
40 changes: 0 additions & 40 deletions nvim/lua/my/pack/vimwiki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,3 @@ vim.g.vimwiki_list = {

vim.g.vimwiki_folding = 'expr'
vim.g.vimwiki_auto_chdir = 1

local pickers = require "telescope.pickers"
local finders = require "telescope.finders"
local actions = require "telescope.actions"
local action_state = require('telescope.actions.state')
local conf = require("telescope.config").values

local function new_ui_wiki_select()
pickers.new({}, {
prompt_title = "Select Wiki",
finder = finders.new_table {
results = vim.tbl_map(function(v)
return v.name
end, vim.g.vimwiki_list),
},
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local value = action_state.get_selected_entry()[1]
local index = 1

for i, v in ipairs(vim.g.vimwiki_list) do
if v.name == value then
index = i
break
end
end

print(vim.inspect(index))

vim.cmd('VimwikiIndex '..index)
end)
return true
end,
sorter = conf.generic_sorter({}),
}):find()
end

vim.keymap.set({ 'n' }, '<leader>ws', new_ui_wiki_select, {})
vim.api.nvim_create_user_command('VimwikiNewUISelect', new_ui_wiki_select, {})

0 comments on commit 173c219

Please sign in to comment.