Compare commits
9 Commits
04f1abe4d1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 38709a3b71 | |||
| 391b30bd7a | |||
| 0af71243a3 | |||
| d0ea7c50a0 | |||
| 233275c160 | |||
| ccd0319364 | |||
| f11dae4fce | |||
| 09e50948e4 | |||
| d1167c2fe9 |
@@ -133,8 +133,7 @@ require('lazy').setup({
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
'nvim-telescope/telescope.nvim', version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
@@ -154,22 +153,37 @@ require('lazy').setup({
|
||||
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch="main",
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.config').setup({
|
||||
ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = { 'ruby' },
|
||||
},
|
||||
indent = { enable = true, disable = { 'ruby' } },
|
||||
})
|
||||
end,
|
||||
-- config = function()
|
||||
-- require('nvim-treesitter.configs').setup({
|
||||
-- ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
||||
-- auto_install = true,
|
||||
-- highlight = {
|
||||
-- enable = true,
|
||||
-- additional_vim_regex_highlighting = { 'ruby' },
|
||||
-- },
|
||||
-- indent = { enable = true, disable = { 'ruby' } },
|
||||
-- })
|
||||
-- end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
branch="main"
|
||||
},
|
||||
init = function()
|
||||
local ensureInstalled = {
|
||||
'lua', 'python', 'typescript',
|
||||
-- ... your parsers
|
||||
}
|
||||
local alreadyInstalled = require('nvim-treesitter.config').get_installed()
|
||||
local parsersToInstall = vim.iter(ensureInstalled)
|
||||
:filter(function(parser)
|
||||
return not vim.tbl_contains(alreadyInstalled, parser)
|
||||
end)
|
||||
:totable()
|
||||
require('nvim-treesitter').install(parsersToInstall)
|
||||
end,
|
||||
},
|
||||
|
||||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
||||
@@ -262,50 +276,6 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous dia
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||
|
||||
-- [[ Configure LSP ]]
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself
|
||||
-- many times.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
-- require('neodev').setup()
|
||||
|
||||
@@ -66,6 +66,7 @@ keymap.set('n', '<M-1>', '<cmd>ToggleTerm direction=horizontal<cr>', { silent =
|
||||
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
|
||||
keymap.set('n', '<leader>fs', '<Plug>(easymotion-sn)', { silent = true })
|
||||
keymap.set('n', '<leader>w', '<Plug>(easymotion-overwin-f2)', { silent = true })
|
||||
keymap.set('n', 'gl', '<Plug>(easymotion-sl)', { silent = true })
|
||||
|
||||
vim.g.EasyMotion_smartcase = 1
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ local on_attach = function(_, bufnr)
|
||||
keymap.set("n", "<leader>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>")
|
||||
keymap.set("n", "<leader>dp", "<cmd>Lspsaga diagnostic_jump_prev<CR>")
|
||||
|
||||
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_next_start('@function.outer')<CR>",
|
||||
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_next_start('@function.outer')<CR>",
|
||||
opts)
|
||||
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_previous_start('@function.outer')<CR>",
|
||||
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_previous_start('@function.outer')<CR>",
|
||||
opts)
|
||||
end
|
||||
|
||||
@@ -158,16 +158,8 @@ setup_server("intelephense", {
|
||||
init_options = {
|
||||
licenceKey = (function()
|
||||
local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt")
|
||||
<<<<<<< HEAD
|
||||
if vim.fn.filereadable(license_path) == 1 then
|
||||
return vim.fn.readfile(license_path)[1]
|
||||
=======
|
||||
local file = io.open(license_path, "r")
|
||||
if file then
|
||||
local content = file:read("*l") -- read first line
|
||||
file:close()
|
||||
return content
|
||||
>>>>>>> fbcc0b8d619e6f84448645f49d0a1dda9de840e5
|
||||
end
|
||||
return nil
|
||||
end)(),
|
||||
@@ -194,10 +186,10 @@ setup_server("intelephense", {
|
||||
-- phpcs / phpstan configs
|
||||
vim.g.nvim_phpcs_config_phpcs_path = 'phpcs'
|
||||
vim.g.nvim_phpcs_config_phpcbf_path = 'phpcbf'
|
||||
vim.g.ale_php_phpstan_executable = '/home/mace/.config/composer/vendor/bin/phpstan'
|
||||
vim.g.ale_php_phpstan_executable = '~/.config/composer/vendor/bin/phpstan'
|
||||
|
||||
local phpcs_config = "/home/mace/repos/configs/phpcs.xml"
|
||||
local phpcs_config_new = "/home/mace/repos/dotfiles/phpcs.xml"
|
||||
local phpcs_config = "~/repos/configs/phpcs.xml"
|
||||
local phpcs_config_new = "~/repos/dotfiles/phpcs.xml"
|
||||
if vim.loop.fs_stat(phpcs_config_new) then
|
||||
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new
|
||||
elseif vim.loop.fs_stat(phpcs_config) then
|
||||
|
||||
@@ -74,13 +74,15 @@ return {
|
||||
"easymotion/vim-easymotion",
|
||||
|
||||
-- Markdown
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
ft = "markdown",
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "iamcco/markdown-preview.nvim",
|
||||
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
-- build = "cd app && yarn install",
|
||||
-- init = function()
|
||||
-- vim.g.mkdp_filetypes = { "markdown" }
|
||||
-- end,
|
||||
-- ft = { "markdown" },
|
||||
-- },
|
||||
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
|
||||
@@ -23,6 +23,9 @@ telescope.setup({
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
preview = {
|
||||
treesitter = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ nnoremap ,b :buffers<CR>
|
||||
nnoremap <leader>y "+yy
|
||||
vnoremap <leader>y "+y
|
||||
|
||||
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
":nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
" xnoremap ("<leader>p", "\"_dP")
|
||||
" autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
|
||||
|
||||
Reference in New Issue
Block a user