cleanup
This commit is contained in:
		
							parent
							
								
									fb47b1f896
								
							
						
					
					
						commit
						3974ab5bb4
					
				@ -5,7 +5,7 @@ local M = {
 | 
				
			|||||||
	dependencies = { 'hrsh7th/cmp-nvim-lsp' },
 | 
						dependencies = { 'hrsh7th/cmp-nvim-lsp' },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M.tools = {
 | 
					local tools = {
 | 
				
			||||||
	'clangd',
 | 
						'clangd',
 | 
				
			||||||
	'gopls',
 | 
						'gopls',
 | 
				
			||||||
	'sumneko_lua',
 | 
						'sumneko_lua',
 | 
				
			||||||
@ -81,7 +81,7 @@ function M.config()
 | 
				
			|||||||
		-- util.info(client.name .. " " .. (enable and "yes" or "no"), "format")
 | 
							-- util.info(client.name .. " " .. (enable and "yes" or "no"), "format")
 | 
				
			||||||
		client.server_capabilities.documentFormattingProvider = enable
 | 
							client.server_capabilities.documentFormattingProvider = enable
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	for _, tool in ipairs(M.tools) do
 | 
						for _, tool in ipairs(tools) do
 | 
				
			||||||
		opts = {
 | 
							opts = {
 | 
				
			||||||
			on_attach = on_attach,
 | 
								on_attach = on_attach,
 | 
				
			||||||
			capabilities = capabilities,
 | 
								capabilities = capabilities,
 | 
				
			||||||
 | 
				
			|||||||
@ -3,28 +3,28 @@ local M = {
 | 
				
			|||||||
	cmd = 'Mason',
 | 
						cmd = 'Mason',
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M.tools = {
 | 
					-- M.tools = {
 | 
				
			||||||
	'clang-format',
 | 
					-- 	'clang-format',
 | 
				
			||||||
	'clangd',
 | 
					-- 	'clangd',
 | 
				
			||||||
	'gopls',
 | 
					-- 	'gopls',
 | 
				
			||||||
	-- 'lua-language-server',
 | 
					-- 	-- 'lua-language-server',
 | 
				
			||||||
	'rust-analyzer',
 | 
					-- 	'rust-analyzer',
 | 
				
			||||||
	'prettierd',
 | 
					-- 	'prettierd',
 | 
				
			||||||
	-- 'stylua',
 | 
					-- 	-- 'stylua',
 | 
				
			||||||
	'shellcheck',
 | 
					-- 	'shellcheck',
 | 
				
			||||||
	'shfmt',
 | 
					-- 	'shfmt',
 | 
				
			||||||
	'black',
 | 
					-- 	'black',
 | 
				
			||||||
}
 | 
					-- }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function M.check()
 | 
					-- function M.check()
 | 
				
			||||||
	local mr = require 'mason-registry'
 | 
					-- 	local mr = require 'mason-registry'
 | 
				
			||||||
	for _, tool in ipairs(M.tools) do
 | 
					-- 	for _, tool in ipairs(M.tools) do
 | 
				
			||||||
		local p = mr.get_package(tool)
 | 
					-- 		local p = mr.get_package(tool)
 | 
				
			||||||
		if not p:is_installed() then
 | 
					-- 		if not p:is_installed() then
 | 
				
			||||||
			p:install()
 | 
					-- 			p:install()
 | 
				
			||||||
		end
 | 
					-- 		end
 | 
				
			||||||
	end
 | 
					-- 	end
 | 
				
			||||||
end
 | 
					-- end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function M.config()
 | 
					function M.config()
 | 
				
			||||||
	require('mason').setup {
 | 
						require('mason').setup {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,16 +1,16 @@
 | 
				
			|||||||
local function project_files()
 | 
					-- local function project_files()
 | 
				
			||||||
	local opts = {}
 | 
					-- 	local opts = {}
 | 
				
			||||||
	if vim.loop.fs_stat '.git' then
 | 
					-- 	if vim.loop.fs_stat '.git' then
 | 
				
			||||||
		opts.show_untracked = true
 | 
					-- 		opts.show_untracked = true
 | 
				
			||||||
		require('telescope.builtin').git_files(opts)
 | 
					-- 		require('telescope.builtin').git_files(opts)
 | 
				
			||||||
	else
 | 
					-- 	else
 | 
				
			||||||
		local client = vim.lsp.get_active_clients()[1]
 | 
					-- 		local client = vim.lsp.get_active_clients()[1]
 | 
				
			||||||
		if client then
 | 
					-- 		if client then
 | 
				
			||||||
			opts.cwd = client.config.root_dir
 | 
					-- 			opts.cwd = client.config.root_dir
 | 
				
			||||||
		end
 | 
					-- 		end
 | 
				
			||||||
		require('telescope.builtin').find_files(opts)
 | 
					-- 		require('telescope.builtin').find_files(opts)
 | 
				
			||||||
	end
 | 
					-- 	end
 | 
				
			||||||
end
 | 
					-- end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local M = {
 | 
					local M = {
 | 
				
			||||||
	'nvim-telescope/telescope.nvim',
 | 
						'nvim-telescope/telescope.nvim',
 | 
				
			||||||
@ -45,6 +45,7 @@ function M.config()
 | 
				
			|||||||
	telescope.setup {
 | 
						telescope.setup {
 | 
				
			||||||
		pickers = {
 | 
							pickers = {
 | 
				
			||||||
			find_files = {
 | 
								find_files = {
 | 
				
			||||||
 | 
									find_command = { 'fd', '--type', 'f', '--strip-cwd-prefix' },
 | 
				
			||||||
				theme = 'dropdown',
 | 
									theme = 'dropdown',
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			live_grep = {
 | 
								live_grep = {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user