completiongit add .

This commit is contained in:
Talon 2023-07-28 00:22:35 -06:00
parent 66874c59b4
commit 04a91c6d05
3 changed files with 71 additions and 50 deletions

View file

@ -1,4 +1,4 @@
(let [nmap #(vim.keymap.set :n $1 $2 {:desc "$3"})] (let [nmap #(vim.keymap.set [:n] $1 $2 {:desc $3})]
(nmap "<Tab>" ":bnext<CR>" "Next Buffer") (nmap "<Tab>" ":bnext<CR>" "Next Buffer")
(nmap "<S-Tab>" ":bprevious<CR>" "Previous Buffer") (nmap "<S-Tab>" ":bprevious<CR>" "Previous Buffer")
(nmap "<C-X>" ":write|bdelete<CR>" "Save and delete buffer") (nmap "<C-X>" ":write|bdelete<CR>" "Save and delete buffer")
@ -6,5 +6,4 @@
(nmap "<C-P>" ":Telescope find_files<CR>" "Telescope find_files") (nmap "<C-P>" ":Telescope find_files<CR>" "Telescope find_files")
(nmap "<C-F>" ":Telescope live_grep<CR>" "Telescope live_grep") (nmap "<C-F>" ":Telescope live_grep<CR>" "Telescope live_grep")
(nmap "<C-B>" ":Telescope buffers<CR>" "Telescope buffers") (nmap "<C-B>" ":Telescope buffers<CR>" "Telescope buffers")
(nmap "<C-T>" ":Telescope treesitter<CR>" "Telescope treesitter") (nmap "<C-T>" ":Telescope treesitter<CR>" "Telescope treesitter"))
)

View file

@ -1,48 +1,51 @@
(let [lazypath (.. (vim.fn.stdpath "data") "/lazy/lazy.nvim")] ;; Package Management via lazy.nvim
(if (not (vim.loop.fs_stat lazypath)) (let
(vim.fn.system [lazy (require :lazy)
["git" lazypath (.. (vim.fn.stdpath "data") "/lazy/lazy.nvim")
"clone" ]
"--filter=blob:none" (if (not (vim.loop.fs_stat lazypath))
"https://github.com/folke/lazy.nvim.git" (vim.fn.system
"--branch=stable" ["git"
lazypath])) "clone"
(vim.opt.rtp:prepend lazypath)) "--filter=blob:none"
"https://github.com/folke/lazy.nvim.git"
(let [lazy (require :lazy)] "--branch=stable"
(lazy.setup lazypath]))
["https://github.com/rktjmp/hotpot.nvim" (vim.opt.rtp:prepend lazypath)
{:url "https://github.com/nvim-telescope/telescope.nvim" (lazy.setup
:tag "0.1.2" ["https://github.com/rktjmp/hotpot.nvim"
:dependencies ["nvim-lua/plenary.nvim"]} {:url "https://github.com/nvim-telescope/telescope.nvim"
{:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim" :tag "0.1.2"
:build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release" :dependencies ["nvim-lua/plenary.nvim"]}
" && cmake --build build --config Release" {:url "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
" && cmake --install build --prefix build" )} :build (.. "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release"
{:url "https://github.com/nvim-treesitter/nvim-treesitter" " && cmake --build build --config Release"
:build ":TSUpdate"} " && cmake --install build --prefix build" )}
{:url "https://github.com/neovim/nvim-lspconfig" {:url "https://github.com/nvim-treesitter/nvim-treesitter"
:dependencies :build ":TSUpdate"}
["https://github.com/williamboman/mason.nvim" {:url "https://github.com/neovim/nvim-lspconfig"
"williamboman/mason-lspconfig.nvim" :dependencies
{:url "https://github.com/j-hui/fidget.nvim" ["https://github.com/williamboman/mason.nvim"
:tag "legacy" "williamboman/mason-lspconfig.nvim"
:opts {}} {:url "https://github.com/j-hui/fidget.nvim"
"folke/neodev.nvim" :tag "legacy"
]} :opts {}}
{:url "https://github.com/hrsh7th/nvim-cmp" "folke/neodev.nvim"
:dependencies ]}
["https://github.com/hrsh7th/cmp-nvim-lsp" {:url "https://github.com/hrsh7th/nvim-cmp"
"https://github.com/hrsh7th/cmp-buffer" :dependencies
"https://github.com/hrsh7th/cmp-path" ["https://github.com/hrsh7th/cmp-nvim-lsp"
"https://github.com/hrsh7th/cmp-cmdline" "https://github.com/hrsh7th/cmp-buffer"
"https://github.com/hrsh7th/cmp-cmdline" "https://github.com/hrsh7th/cmp-path"
]} "https://github.com/hrsh7th/cmp-cmdline"
{:url "https://github.com/L3MON4D3/LuaSnip" "https://github.com/hrsh7th/cmp-cmdline"
:dependencies ]}
[{:url "https://github.com/saadparwaiz1/cmp_luasnip"} {:url "https://github.com/L3MON4D3/LuaSnip"
]} :dependencies
])) [{:url "https://github.com/saadparwaiz1/cmp_luasnip"}
{:url "https://github.com/rafamadriz/friendly-snippets"}
]}
]))
(let [telescope (require :telescope)] (let [telescope (require :telescope)]
(pcall (telescope.load_extension :fzf))) (pcall (telescope.load_extension :fzf)))
@ -106,19 +109,37 @@
settings (. servers server_name) settings (. servers server_name)
] ]
(server.setup (server.setup
{:capabilities (cmp-nvim-lsp.default_capabilities) {:capabilities (cmp-nvim-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities))
:on_attach on_attach :on_attach on_attach
:settings settings :settings settings
:filetypes (or settings.filetypes [])}))) :filetypes (or settings.filetypes [])})))
])) ]))
;; Autocompletion and Snippets with nvim-cmp ;; Autocompletion and Snippets with nvim-cmp and luasnip
(let (let
[cmp (require :cmp) [cmp (require :cmp)
luasnip (require :luasnip) luasnip (require :luasnip)
vscode-snips (require :luasnip.loaders.from_vscode)
] ]
(vscode-snips.lazy_load)
(luasnip.config.setup)
(cmp.setup (cmp.setup
{:snippet {:expand #(luasnip $1)} {:snippet {:expand #(luasnip $1)}
:mapping (cmp.mapping.preset.insert
{:<C-j> (cmp.mapping.select_next_item)
:<C-k> (cmp.mapping.select_prev_item)
:<C-d> (cmp.mapping.scroll_docs -4)
:<C-f> (cmp.mapping.scroll_docs 4)
:<C-Space> (cmp.mapping.complete)
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true})
:<Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump)
(fallback))) [:i :s])
:<S-Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.locally_jumpable -1) (luasnip.jump -1)
(fallback))) [:i :s])})
:sources (cmp.config.sources :sources (cmp.config.sources
[{:name :nvim_lsp} [{:name :nvim_lsp}
{:name :luasnip} {:name :luasnip}

View file

@ -6,6 +6,7 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" },
"hotpot.nvim": { "branch": "master", "commit": "026eba9596b506ab6f807fd4aa93cd5f76255725" }, "hotpot.nvim": { "branch": "master", "commit": "026eba9596b506ab6f807fd4aa93cd5f76255725" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },