Compare commits

...

11 Commits

Author SHA1 Message Date
Mathias Rothenhaeusler 38709a3b71 remove markdown, not working 2026-06-10 08:10:14 +02:00
mathias 391b30bd7a updated new textobjects method 2026-05-24 14:29:08 +02:00
mathias 0af71243a3 remove old leader s from vimrc 2026-05-20 21:22:55 +02:00
mathias d0ea7c50a0 gl mapping 2026-05-06 19:53:03 +02:00
mathias 233275c160 added gl, easymotion in line 2026-05-05 19:31:44 +02:00
mathias ccd0319364 fix some paths, install rust-analyzer not in mason! 2026-05-05 19:22:04 +02:00
Mathias Rothenhaeusler f11dae4fce fix telescope preview 2026-04-22 16:58:18 +02:00
mathias 09e50948e4 treesitter for nvim 0.12 2026-04-19 13:01:12 +02:00
mathias d1167c2fe9 fix treesitter config, configs issue 2026-04-03 10:55:43 +02:00
Mathias Rothenhaeusler 04f1abe4d1 Merge branch 'main' of https://gitea.safemind.net/mathias/nvim-kickstart 2026-04-03 10:42:28 +02:00
mathias 821f9bee27 fix treesitter config 2026-04-03 10:35:50 +02:00
6 changed files with 49 additions and 85 deletions
+28 -67
View File
@@ -133,8 +133,7 @@ require('lazy').setup({
-- Fuzzy Finder (files, lsp, etc) -- Fuzzy Finder (files, lsp, etc)
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim', version = '*',
branch = '0.1.x',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
-- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Fuzzy Finder Algorithm which requires local dependencies to be built.
@@ -154,31 +153,37 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
branch="main",
lazy = false,
build = ':TSUpdate', build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- config = function()
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- require('nvim-treesitter.configs').setup({
opts = { -- ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- auto_install = true,
-- Autoinstall languages that are not installed -- highlight = {
auto_install = true, -- enable = true,
highlight = { -- additional_vim_regex_highlighting = { 'ruby' },
enable = true, -- },
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- indent = { enable = true, disable = { 'ruby' } },
-- If you are experiencing weird indenting issues, add the language to -- })
-- the list of additional_vim_regex_highlighting and disabled languages for indent. -- end,
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
branch="main"
}, },
-- There are additional nvim-treesitter modules that you can use to interact init = function()
-- with nvim-treesitter. You should go explore a few and see what interests you: local ensureInstalled = {
-- 'lua', 'python', 'typescript',
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` -- ... your parsers
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context }
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects 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 -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
@@ -271,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', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) 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 -- Setup neovim lua configuration
-- require('neodev').setup() -- require('neodev').setup()
+1
View File
@@ -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>f', '<Plug>(easymotion-prefix)', { silent = true })
keymap.set('n', '<leader>fs', '<Plug>(easymotion-sn)', { 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', '<leader>w', '<Plug>(easymotion-overwin-f2)', { silent = true })
keymap.set('n', 'gl', '<Plug>(easymotion-sl)', { silent = true })
vim.g.EasyMotion_smartcase = 1 vim.g.EasyMotion_smartcase = 1
+7 -10
View File
@@ -82,9 +82,9 @@ local on_attach = function(_, bufnr)
keymap.set("n", "<leader>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>") 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", "<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) 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) opts)
end end
@@ -158,11 +158,8 @@ setup_server("intelephense", {
init_options = { init_options = {
licenceKey = (function() licenceKey = (function()
local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt") local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt")
local file = io.open(license_path, "r") if vim.fn.filereadable(license_path) == 1 then
if file then return vim.fn.readfile(license_path)[1]
local content = file:read("*l") -- read first line
file:close()
return content
end end
return nil return nil
end)(), end)(),
@@ -189,10 +186,10 @@ setup_server("intelephense", {
-- phpcs / phpstan configs -- phpcs / phpstan configs
vim.g.nvim_phpcs_config_phpcs_path = 'phpcs' vim.g.nvim_phpcs_config_phpcs_path = 'phpcs'
vim.g.nvim_phpcs_config_phpcbf_path = 'phpcbf' 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 = "~/repos/configs/phpcs.xml"
local phpcs_config_new = "/home/mace/repos/dotfiles/phpcs.xml" local phpcs_config_new = "~/repos/dotfiles/phpcs.xml"
if vim.loop.fs_stat(phpcs_config_new) then if vim.loop.fs_stat(phpcs_config_new) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new
elseif vim.loop.fs_stat(phpcs_config) then elseif vim.loop.fs_stat(phpcs_config) then
+9 -7
View File
@@ -74,13 +74,15 @@ return {
"easymotion/vim-easymotion", "easymotion/vim-easymotion",
-- Markdown -- Markdown
{ -- {
"iamcco/markdown-preview.nvim", -- "iamcco/markdown-preview.nvim",
ft = "markdown", -- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = function() -- build = "cd app && yarn install",
vim.fn["mkdp#util#install"]() -- init = function()
end, -- vim.g.mkdp_filetypes = { "markdown" }
}, -- end,
-- ft = { "markdown" },
-- },
{ {
'akinsho/bufferline.nvim', 'akinsho/bufferline.nvim',
+3
View File
@@ -23,6 +23,9 @@ telescope.setup({
['<C-d>'] = false, ['<C-d>'] = false,
}, },
}, },
preview = {
treesitter = false,
},
}, },
}) })
+1 -1
View File
@@ -44,7 +44,7 @@ nnoremap ,b :buffers<CR>
nnoremap <leader>y "+yy nnoremap <leader>y "+yy
vnoremap <leader>y "+y vnoremap <leader>y "+y
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>/ ":nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" xnoremap ("<leader>p", "\"_dP") " xnoremap ("<leader>p", "\"_dP")
" autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab " autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab