removed symlinks
This commit is contained in:
parent
7329897a6b
commit
96fd1c7641
@ -1 +0,0 @@
|
||||
/home/Nicholai/.local/share/neovim/titus-kickstart/LICENSE.md
|
||||
219
init.lua
Normal file
219
init.lua
Normal file
@ -0,0 +1,219 @@
|
||||
-- Basic Settings - just throwing some text here to update the status
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.mouse = 'a'
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.wrap = false
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Plugins
|
||||
require("lazy").setup({
|
||||
-- Color scheme
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "catppuccin-mocha"
|
||||
end,
|
||||
},
|
||||
|
||||
-- File explorer
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("nvim-tree").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Fuzzy finder
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("telescope").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
format_on_save = { timeout_ms = 1000, lsp_fallback = true },
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettierd", "prettier" },
|
||||
javascriptreact = { "prettierd", "prettier" },
|
||||
typescript = { "prettierd", "prettier" },
|
||||
typescriptreact = { "prettierd", "prettier" },
|
||||
json = { "prettierd", "prettier" },
|
||||
css = { "prettierd", "prettier" },
|
||||
html = { "prettierd", "prettier" },
|
||||
markdown = { "prettierd", "prettier" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua", "vim", "bash", "javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma",
|
||||
"graphql"
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Autocompletion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- plugins (append to your lazy setup)
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
build = ":MasonUpdate",
|
||||
config = true,
|
||||
},
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
},
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
},
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
|
||||
{ "NvChad/nvim-colorizer.lua", opts = { user_default_options = { names = false } } },
|
||||
{ "luckasRanarison/tailwind-tools.nvim", opts = { document_color = { enabled = true } } },
|
||||
|
||||
|
||||
-- Status line
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = { theme = "catppuccin" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Key mappings
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
-- File explorer
|
||||
keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = "Toggle file explorer" })
|
||||
|
||||
-- Fuzzy finder
|
||||
keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = "Find files" })
|
||||
keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { desc = "Live grep" })
|
||||
keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { desc = "Find buffers" })
|
||||
|
||||
-- Better window navigation
|
||||
keymap('n', '<C-h>', '<C-w>h')
|
||||
keymap('n', '<C-j>', '<C-w>j')
|
||||
keymap('n', '<C-k>', '<C-w>k')
|
||||
keymap('n', '<C-l>', '<C-w>l')
|
||||
|
||||
-- Quick save and quit
|
||||
keymap('n', '<leader>w', ':w<CR>', { desc = "Save" })
|
||||
keymap('n', '<leader>q', ':q<CR>', { desc = "Quit" })
|
||||
|
||||
-- cmp: add LSP and snippets to your existing config
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
local lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = lsp.default_capabilities()
|
||||
|
||||
cmp.setup({
|
||||
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping.select_next_item(),
|
||||
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
{ name = "luasnip" },
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP setup
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "ts_ls", "eslint", "jsonls", "html", "cssls", "tailwindcss" },
|
||||
})
|
||||
|
||||
-- TypeScript
|
||||
require("typescript-tools").setup({
|
||||
settings = {
|
||||
tsserver_file_preferences = { includeInlayParameterNameHints = "all", includeCompletionsForModuleExports = true },
|
||||
},
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user