configure

This commit is contained in:
Abdullah Bodur 2025-10-01 02:32:11 +02:00
parent 17a60c859a
commit b48f9039c1
7 changed files with 191 additions and 29 deletions

View File

@ -100,10 +100,14 @@ vim.g.have_nerd_font = false
-- Make line numbers default -- Make line numbers default
-- vim.opt.number = true -- vim.opt.number = true
-- You can also add relative line numbers, to help with jumping. -- You can also add reeative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
vim.opt.relativenumber = true vim.opt.relativenumber = true
-- Ensure line numbers are always visible
vim.opt.numberwidth = 4 -- Width of number column
vim.opt.signcolumn = 'yes' -- Always show sign column
-- Enable mouse mode, can be useful for resizing splits for example! -- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a' vim.opt.mouse = 'a'
@ -144,8 +148,8 @@ vim.opt.splitbelow = true
-- Sets how neovim will display certain whitespace characters in the editor. -- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'` -- See `:help 'list'`
-- and `:help 'listchars'` -- and `:help 'listchars'`
vim.opt.list = true vim.opt.list = false -- Disable showing whitespace characters
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' } -- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- Preview substitutions live, as you type! -- Preview substitutions live, as you type!
vim.opt.inccommand = 'split' vim.opt.inccommand = 'split'
@ -156,6 +160,65 @@ vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor. -- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10 vim.opt.scrolloff = 10
-- Configure fillchars to show empty lines
vim.opt.fillchars = {
eob = ' ', -- End of buffer character (empty line indicator)
fold = ' ', -- Fold indicator
foldopen = '', -- Fold open indicator
foldclose = '', -- Fold close indicator
foldsep = '', -- Fold separator
diff = '', -- Diff indicator
msgsep = ' ', -- Message separator
vert = '', -- Vertical split character
horiz = '', -- Horizontal split character
horizup = '', -- Horizontal up split character
horizdown = '', -- Horizontal down split character
}
-- Show empty lines at the end of buffer
vim.opt.display = 'lastline'
-- Enable virtual text for better empty line visibility
vim.opt.virtualedit = 'onemore'
-- Indent configuration
vim.opt.tabstop = 2 -- Number of spaces a tab counts for
vim.opt.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent
vim.opt.softtabstop = 2 -- Number of spaces that a tab counts for while performing editing operations
vim.opt.expandtab = true -- Use spaces instead of tabs
vim.opt.smartindent = true -- Smart autoindenting when starting a new line
vim.opt.autoindent = true -- Copy indent from current line when starting a new line
-- Filetype-specific indent settings
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'python', 'yaml', 'yml' },
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
end,
})
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'go', 'rust' },
callback = function()
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4
vim.opt_local.expandtab = false -- Use tabs for Go and Rust
end,
})
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'kotlin', 'java', 'javascript', 'typescript', 'lua' },
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true
end,
})
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
@ -218,6 +281,9 @@ vim.opt.rtp:prepend(lazypath)
-- Load LSP configurations -- Load LSP configurations
require 'config.lspconfig' require 'config.lspconfig'
require 'config.diagnostic' require 'config.diagnostic'
-- Load filetype configurations
require 'config.filetypes'
-- [[ Configure and install plugins ]] -- [[ Configure and install plugins ]]
-- --
-- To check the current status of your plugins, run -- To check the current status of your plugins, run
@ -285,6 +351,8 @@ require('lazy').setup({
-- LSP Plugins -- LSP Plugins
require 'plugins.lazydev', require 'plugins.lazydev',
-- nvim bar plugin
require 'plugins.lualine',
require 'plugins.java', require 'plugins.java',
require 'plugins.conform', require 'plugins.conform',

22
lua/config/filetypes.lua Normal file
View File

@ -0,0 +1,22 @@
-- Filetype detection configuration
-- This file ensures proper filetype detection for various languages
-- Kotlin filetype detection
vim.filetype.add({
extension = {
kt = 'kotlin',
kts = 'kotlin',
},
pattern = {
['.*%.kt$'] = 'kotlin',
['.*%.kts$'] = 'kotlin',
},
})
-- Ensure treesitter highlights are applied
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'kotlin', 'java' },
callback = function()
vim.treesitter.start()
end,
})

View File

@ -1,25 +1,34 @@
-- LSP configuration for Kotlin -- LSP configuration for Kotlin and Java with Maven support
-- This file contains LSP server configurations that are loaded on startup -- This file contains LSP server configurations that are loaded on startup
return function()
-- Kotlin LSP configuration (Official Kotlin LSP)
vim.lsp.config('kotlin_language_server', {
filetypes = { 'kotlin' },
root_markers = {
'pom.xml',
'build.gradle',
'build.gradle.kts',
'settings.gradle',
'settings.gradle.kts'
},
single_file_support = true,
})
vim.lsp.enable('kotlin_language_server')
-- Enable Kotlin LSP vim.lsp.set_log_level("debug")
vim.lsp.config('kotlin_lsp', {
filetypes = { 'kotlin' },
root_markers = {
'settings.gradle',
'settings.gradle.kts',
'pom.xml',
},
})
vim.lsp.config('jdtls', { -- Java LSP configuration
filetypes = { 'java' }, vim.lsp.config('jdtls', {
root_markers = { filetypes = { 'java' },
'pom.xml', root_markers = {
'build.gradle', 'pom.xml',
'build.gradle.kts', 'build.gradle',
}, 'build.gradle.kts',
}) '.git'
},
vim.lsp.enable('kotlin_lsp') single_file_support = true,
vim.diagnostic.enable() })
vim.lsp.enable('jdtls')
end

View File

@ -1,6 +1,32 @@
-- VSCode-inspired colorscheme configuration -- Kanagawa colorscheme configuration
return { return {
"rebelot/kanagawa.nvim" "rebelot/kanagawa.nvim",
config = function()
require('kanagawa').setup({
-- Available modes: 'wave', 'lotus', 'dragon'
-- 'wave' - Default, balanced colors
-- 'lotus' - Lighter, more pastel colors
-- 'dragon' - Darker, more vibrant colors
theme = "wave", -- Change this to 'lotus' or 'dragon' for different modes
-- Additional options
transparent = false,
terminal_colors = true,
colors = {
-- You can override specific colors here if needed
-- palette = {},
-- theme = {},
},
overrides = function(colors)
return {
-- Custom overrides can go here
}
end,
})
-- Set the colorscheme
vim.cmd("colorscheme kanagawa")
end,
} }

View File

@ -1,2 +1,28 @@
return {} return {
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function()
require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = { 'kotlin_language_server', 'jdtls' },
automatic_installation = true,
handlers = {
-- Default handler for all servers
function(server_name)
vim.lsp.config(server_name, {})
end,
-- Custom handler for specific servers
kotlin_language_server = function()
require('config.lspconfig')()
end,
jdtls = function()
require('config.lspconfig')()
end,
}
})
end,
}

11
lua/plugins/lualine.lua Normal file
View File

@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
theme = "tomorrow_night",
}
})
end
}

View File

@ -4,7 +4,7 @@ return {
build = ':TSUpdate', build = ':TSUpdate',
main = 'nvim-treesitter.configs', main = 'nvim-treesitter.configs',
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'java', 'kotlin' }, ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'java', 'kotlin', 'javascript' },
auto_install = true, auto_install = true,
highlight = { highlight = {
enable = true, enable = true,