Skip to content
Closed

Merge #1745

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 95 additions & 50 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,16 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true

-- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`

-- Make line numbers default
vim.o.number = true
vim.opt.number = true
vim.wo.relativenumber = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true
Expand All @@ -114,9 +115,9 @@ vim.o.showmode = false
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.o.clipboard = 'unnamedplus'
end)
-- vim.schedule(function()
-- vim.opt.clipboard = 'unnamedplus'
-- end)

-- Enable break indent
vim.o.breakindent = true
Expand All @@ -141,6 +142,8 @@ vim.o.timeoutlen = 300
vim.o.splitright = true
vim.o.splitbelow = true

vim.opt.wrap = true

-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
Expand Down Expand Up @@ -247,6 +250,10 @@ rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins.
require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
-- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
-- 'phha/zenburn.nvim', -- not great
-- 'tomasiser/vim-code-dark',
-- 'ribru17/bamboo.nvim',
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically

-- NOTE: Plugins can also be added by using a table,
Expand Down Expand Up @@ -283,6 +290,36 @@ require('lazy').setup({
},
},
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration

-- Only one of these is needed.
"nvim-telescope/telescope.nvim", -- optional
"ibhagwan/fzf-lua", -- optional
"echasnovski/mini.pick", -- optional
},
integrations = {
diffview = true
},
config = true
},

{
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim', -- required
'sindrets/diffview.nvim', -- optional - Diff integration

-- Only one of these is needed.
'nvim-telescope/telescope.nvim', -- optional
'ibhagwan/fzf-lua', -- optional
'echasnovski/mini.pick', -- optional
},
config = true,
},

-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
Expand Down Expand Up @@ -671,9 +708,11 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
clangd = {},
gopls = {},
pyright = {},
kotlin_lsp = {},
phpactor = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
Expand All @@ -683,6 +722,8 @@ require('lazy').setup({
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
--
-- kotlin_language_server = {},
vacuum = {},

lua_ls = {
-- cmd = { ... },
Expand Down Expand Up @@ -736,46 +777,46 @@ require('lazy').setup({
end,
},

{ -- Autoformat
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
timeout_ms = 500,
lsp_format = 'fallback',
}
end
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
},
-- { -- Autoformat
-- 'stevearc/conform.nvim',
-- event = { 'BufWritePre' },
-- cmd = { 'ConformInfo' },
-- keys = {
-- {
-- '<leader>f',
-- function()
-- require('conform').format { async = true, lsp_format = 'fallback' }
-- end,
-- mode = '',
-- desc = '[F]ormat buffer',
-- },
-- },
-- opts = {
-- notify_on_error = false,
-- format_on_save = function(bufnr)
-- -- Disable "format_on_save lsp_fallback" for languages that don't
-- -- have a well standardized coding style. You can add additional
-- -- languages here or re-enable it for the disabled ones.
-- local disable_filetypes = { c = true, cpp = true }
-- if disable_filetypes[vim.bo[bufnr].filetype] then
-- return nil
-- else
-- return {
-- timeout_ms = 500,
-- lsp_format = 'fallback',
-- }
-- end
-- end,
-- formatters_by_ft = {
-- lua = { 'stylua' },
-- -- Conform can also run multiple formatters sequentially
-- -- python = { "isort", "black" },
-- --
-- -- You can use 'stop_after_first' to run the first available formatter from the list
-- -- javascript = { "prettierd", "prettier", stop_after_first = true },
-- },
-- },
-- },

{ -- Autocompletion
'saghen/blink.cmp',
Expand Down Expand Up @@ -944,7 +985,7 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'yaml', 'kotlin' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand All @@ -953,8 +994,9 @@ require('lazy').setup({
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
disable = { "html" },
},
indent = { enable = true, disable = { 'ruby' } },
indent = { enable = true, disable = { 'ruby', "html", "yaml" } },
},
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
Expand All @@ -963,6 +1005,9 @@ require('lazy').setup({
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
},
{
'wellle/context.vim'
},

-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and
Expand Down
5 changes: 5 additions & 0 deletions load-oapi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim.lsp.start {
cmd = { 'openapi-language-server', '-testdata', '/tmp/xyz.txt' },
filetypes = { 'yaml.openapi', 'yaml.oa', 'yaml' },
root_dir = vim.fn.getcwd(),
}
Loading