-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
127 lines (114 loc) Β· 3.27 KB
/
init.lua
File metadata and controls
127 lines (114 loc) Β· 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
-- Bootstrap lazy.nvim if not installed
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", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Setup plugins using lazy.nvim
require("lazy").setup({
-- Add plugins here:
{ "neovim/nvim-lspconfig" }, -- LSP support
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, -- better syntax highlighting
{ "nvim-lua/plenary.nvim" }, -- Useful Lua functions
{ "LnL7/vim-nix" }, -- Nix syntax
{ "nvim-telescope/telescope.nvim" },-- Fuzzy finder
{ "nvim-lualine/lualine.nvim" }, -- Status line
-- { "github/copilot.vim" },
{
'Julian/lean.nvim',
event = { 'BufReadPre *.lean', 'BufNewFile *.lean' },
dependencies = {
'neovim/nvim-lspconfig',
'nvim-lua/plenary.nvim',
},
opts = { -- see below for full configuration options
mappings = true,
}
}
})
-- Your settings
vim.o.syntax = "on"
vim.o.relativenumber = true
vim.o.number = true
vim.o.laststatus = 2
vim.o.hidden = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.incsearch = true
vim.keymap.set('n', 'Q', '<Nop>', {noremap = true})
vim.o.errorbells = false
vim.o.visualbell = true
-- Example: treesitter config
require('nvim-treesitter.configs').setup {
highlight = { enable = true },
ensure_installed = { "typescript", "tsx", "javascript", "lua", "nix", "haskell", "rust" }, -- add your languages
}
-- Example: lualine config
require('lualine').setup {}
-- Example: telescope config
require('telescope').setup {}
-- Setup Haskell LSP using nvim-lspconfig
require('lspconfig').hls.setup{
settings = {
haskell = {
formattingProvider = "formolu", -- or any you prefer
}
}
}
-- Setup Rust LSP (rust-analyzer) using nvim-lspconfig
require('lspconfig').rust_analyzer.setup{
settings = {
['rust-analyzer'] = {
cargo = { allFeatures = true },
}
}
}
-- LSP keymaps
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { desc = "Hover documentation" })
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, { desc = "Rename symbol" })
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, { desc = "Code action" })
vim.keymap.set('n', 'en', vim.diagnostic.goto_next, { desc = "Code action" })
vim.keymap.set('n', 'ep', vim.diagnostic.goto_prev, { desc = "Code action" })
require('lspconfig').nil_ls.setup{
settings = {
['nil'] = {
formatting = {
command = { "nixpkgs-fmt" }
}
}
}
}
require('lspconfig').ts_ls.setup{}
-- require('llm').setup {
-- model = "codegemma",
-- backend = "ollama",
-- url = "http://localhost:11434/api/generate",
-- request_body = {
-- options = {
-- temperature = 0,
-- top_p = 0.9,
-- }
-- },
-- tokens_to_clear = { "<EOT>" },
-- fim = {
-- enabled = true,
-- prefix = "<PRE> ",
-- middle = " <MID>",
-- suffix = " <SUF>",
-- },
-- accept_keymap = "<M-j>",
-- dismiss_keymap = "<M-h>",
-- context_window = 1024,
-- lsp = {
-- version = "0.5.2",
-- },
-- enable_suggestions_on_startup = false,
-- }