diff options
author | Damjan 9000 <damjan.9000@gmail.com> | 2023-12-03 20:44:17 +0100 |
---|---|---|
committer | Damjan 9000 <damjan.9000@gmail.com> | 2023-12-03 20:44:17 +0100 |
commit | a54945c75a1deab7e62d6213e803feaaa9802b9a (patch) | |
tree | 3bae85b6d2322f2e600bbfc8972fc2c057ff40e9 /lua | |
parent | 207ef6a438b06fe0ffe65eea5154a57b703778d7 (diff) | |
parent | 12bd68e8b9bc98242084bce55236d2bf9fe299b1 (diff) |
Merge 'upstream/master' Run stylua
Diffstat (limited to 'lua')
-rw-r--r-- | lua/cmp-setup.lua | 2 | ||||
-rw-r--r-- | lua/telescope-setup.lua | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lua/cmp-setup.lua b/lua/cmp-setup.lua index a78aded..f40ade7 100644 --- a/lua/cmp-setup.lua +++ b/lua/cmp-setup.lua @@ -12,7 +12,7 @@ cmp.setup { end, }, completion = { - completeopt = 'menu,menuone,noinsert' + completeopt = 'menu,menuone,noinsert', }, mapping = cmp.mapping.preset.insert { ['<C-n>'] = cmp.mapping.select_next_item(), diff --git a/lua/telescope-setup.lua b/lua/telescope-setup.lua index b467605..3a4e162 100644 --- a/lua/telescope-setup.lua +++ b/lua/telescope-setup.lua @@ -22,17 +22,17 @@ local function find_git_root() local current_dir local cwd = vim.fn.getcwd() -- If the buffer is not associated with a file, return nil - if current_file == "" then + if current_file == '' then current_dir = cwd else -- Extract the directory from the current file's path - current_dir = vim.fn.fnamemodify(current_file, ":h") + current_dir = vim.fn.fnamemodify(current_file, ':h') end -- Find the Git root directory from the current file's path - local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1] + local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] if vim.v.shell_error ~= 0 then - print("Not a git repository. Searching on current working directory") + print 'Not a git repository. Searching on current working directory' return cwd end return git_root @@ -42,9 +42,9 @@ end local function live_grep_git_root() local git_root = find_git_root() if git_root then - require('telescope.builtin').live_grep({ - search_dirs = {git_root}, - }) + require('telescope.builtin').live_grep { + search_dirs = { git_root }, + } end end |