default js/ts and python setup

This commit is contained in:
Levente Gal 2024-03-06 14:50:14 +02:00
parent f764b7bacd
commit af466b6df8
12 changed files with 165 additions and 5 deletions

View File

@ -728,7 +728,7 @@ require('lazy').setup {
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
vim.cmd.colorscheme 'tokyonight-day'
-- You can configure highlights by doing something like
vim.cmd.hi 'Comment gui=none'
@ -808,16 +808,25 @@ require('lazy').setup {
-- Here are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
-- Enable relative line numbers
vim.wo.relativenumber = true
-- Cursor line
vim.wo.cursorline = true
-- Mark default line with to 140 columns
vim.wo.colorcolumn = '140'

View File

@ -0,0 +1,12 @@
return {
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = {
auto_trigger = true,
}
})
end,
}

View File

@ -0,0 +1,6 @@
return {
"sindrets/diffview.nvim",
}

View File

@ -0,0 +1,9 @@
return {
"ibhagwan/fzf-lua",
-- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
-- calling `setup` is optional for customization
require("fzf-lua").setup({})
end
}

View File

@ -0,0 +1,5 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

View File

@ -0,0 +1,21 @@
return {
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration
"nvim-telescope/telescope.nvim", -- optional
},
config = function()
require("neogit").setup({
kind = "split", -- opens neogit in a split
signs = {
-- { CLOSED, OPENED }
section = { "", "" },
item = { "", "" },
hunk = { "", "" },
},
integrations = { diffview = true }, -- adds integration with diffview.nvim
})
end,
config = true
}

View File

@ -0,0 +1,30 @@
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function()
require('neo-tree').setup {
event_handlers = {
{
event = "file_opened",
handler = function(file_path)
-- auto close
-- vimc.cmd("Neotree close")
-- OR
require("neo-tree.command").execute({ action = "close" })
end
},
} }
end,
vim.keymap.set('n', '<C-e>', '<cmd>Neotree toggle reveal<CR>', { desc = 'Focus Neotree' }),
vim.keymap.set('n', '<leader>gs', '<Cmd>Neotree float git_status<CR>', { desc = 'Git status' }),
}

View File

@ -0,0 +1,23 @@
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
end
return {
'akinsho/toggleterm.nvim',
version = "*",
config = function()
require('toggleterm').setup {}
end,
vim.keymap.set('n', '<leader>tt', '<Cmd>ToggleTerm<CR>', { desc = 'Toggle terminal' }),
vim.keymap.set('n', '<leader>t2', '<Cmd>2ToggleTerm<CR>', { desc = 'Toggle terminal 2' }),
vim.keymap.set('n', '<leader>t3', '<Cmd>3ToggleTerm<CR>', { desc = 'Toggle terminal 3' }),
vim.keymap.set('n', '<leader>t4', '<Cmd>4ToggleTerm<CR>', { desc = 'Toggle terminal 4' }),
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
}

20
lua/custom/plugins/nx.lua Normal file
View File

@ -0,0 +1,20 @@
return {
{
"Equilibris/nx.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
opts = {
nx_cmd_root = "npx nx",
},
-- Plugin will load when you use these keys
keys = {
{ "<leader>nxa", "<cmd>Telescope nx actions<CR>", desc = "nx actions" },
{ "<leader>nxg", "<cmd>Telescope nx generators<CR>", desc = "nx generators" },
{ "<leader>nxf", "<cmd>wa | !npx nx format:write<CR><CR> | :checktime<CR>", desc = "nx format afected" }
},
},
}

View File

@ -0,0 +1,10 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("refactoring").setup({})
end,
}

View File

@ -0,0 +1,7 @@
return {
"Shatur/neovim-session-manager",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require('session_manager').setup({})
end
}

View File

@ -20,6 +20,7 @@ return {
-- Add your own debuggers here
'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python'
},
config = function()
local dap = require 'dap'
@ -43,7 +44,13 @@ return {
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F5>', function()
-- (Re-)reads launch.json if present
if vim.fn.filereadable(".vscode/launch.json") then
require("dap.ext.vscode").load_launchjs()
end
require("dap").continue()
end, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
@ -83,5 +90,6 @@ return {
-- Install golang specific config
require('dap-go').setup()
require("dap-python").setup("python", {})
end,
}