Juni Kim
2 years ago
7 changed files with 88 additions and 26 deletions
-
21after/plugin/lsp.lua
-
27after/plugin/telescope.lua
-
4lua/junikim/init.lua
-
23lua/junikim/options.lua
-
32lua/junikim/packer.lua
-
2lua/junikim/remap.lua
-
5plugin/packer_compiled.lua
@ -1,5 +1,30 @@ |
|||||
local builtin = require("telescope.builtin") |
local builtin = require("telescope.builtin") |
||||
vim.keymap.set('n', '<C-P>', builtin.git_files, {}) |
|
||||
|
|
||||
|
local function git_exists() |
||||
|
local path = require("pl.path") |
||||
|
local p = "." |
||||
|
while true do |
||||
|
local gitpath = p .. "/.git" |
||||
|
local d = io.open(gitpath) |
||||
|
if d then |
||||
|
d:close() |
||||
|
return true |
||||
|
else |
||||
|
p = p .. "/.." |
||||
|
end |
||||
|
if path.abspath(p) ~= "/" then |
||||
|
return false |
||||
|
end |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
vim.keymap.set('n', '<C-P>', function() |
||||
|
if git_exists() then |
||||
|
builtin.git_files() |
||||
|
else |
||||
|
builtin.find_files() |
||||
|
end |
||||
|
end, {}) |
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) |
vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) |
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) |
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) |
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) |
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) |
@ -1,3 +1,3 @@ |
|||||
require("junikim.remap") |
|
||||
require("junikim.options") |
|
||||
require("junikim.packer") |
require("junikim.packer") |
||||
|
require("junikim.options") |
||||
|
require("junikim.remap") |
Write
Preview
Loading…
Cancel
Save
Reference in new issue