You've already forked neovim_config
Compare commits
18 Commits
7e371697d9
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
72cfef9698 | ||
![]() |
93f5c4eeee | ||
![]() |
1b710da032 | ||
5a603aaac0 | |||
40ddc8351a | |||
![]() |
14185f2a77 | ||
![]() |
2ed6432443 | ||
![]() |
f3a4e44c19 | ||
![]() |
b8850e216b | ||
![]() |
3b9053ccb8 | ||
![]() |
8d6b770879 | ||
![]() |
59f0fa31a6 | ||
![]() |
dfa38d3453 | ||
![]() |
739b0ad24d | ||
![]() |
f763f914c7 | ||
260f35039d | |||
a7c3dcf6c3 | |||
ac112f878c |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
lazy-lock.json
|
23
README.md
23
README.md
@@ -8,12 +8,22 @@ neovim has to be version 0.10.0 or later.
|
||||
|
||||
Denpenting on your OS neovim and the requirements can be installed on Rhel or Fedora like this
|
||||
```
|
||||
sudo dnf install neovim npm ansible ansible-lint ripgrep
|
||||
sudo dnf install neovim npm ansible ansible-lint ripgrep ShellCheck
|
||||
```
|
||||
|
||||
If you are using Ubuntu it can be done like this
|
||||
```
|
||||
sudo apt install neovim npm ansible ansible-lint ripgrep
|
||||
sudo apt install neovim npm ansible ansible-lint ripgrep shellcheck
|
||||
```
|
||||
|
||||
If you are using MacOS it can be done like this (Yes ansible is not in there yet, still working on that)
|
||||
```
|
||||
brew install neovim npm python@3.12 shellcheck ansible ansible-lint
|
||||
```
|
||||
|
||||
Remember that you need to have the homeberw path exported
|
||||
```
|
||||
export PATH=$PATH:/opt/homebrew/bin
|
||||
```
|
||||
|
||||
How to use the plugins and configuration
|
||||
@@ -26,3 +36,12 @@ This is a simple starter config for neovim, there is a few plugins for changing
|
||||
### Note:
|
||||
To use the ansiblels LSP, you need either vs code installed or npm installed. May well be that vs code installs and uses npm to install the ansiblels LSP
|
||||
There is also some remaps that I could not image going back to not using, since they make life a lot eaiser and better when it comes to working in files.
|
||||
|
||||
|
||||
### Tabs:
|
||||
There has been added remaps for tabs, <leader>ct creates a new tab, <leader>qt closes a tab. If you are in netrw you can press t on a file to open it in a tab.
|
||||
You can jump between tabs with gt, if you want to jump to a spesific tab you can use fx 2gt, to go to tab 2
|
||||
|
||||
|
||||
### Just a friendly reminder
|
||||
It might be required to go above neovin version 0.10.0, as I have seen some funny errors with the LSP config, so to be safe if you have to option, go with version 0.11.0 or later as that just seams to work
|
||||
|
1
ftdetect/ansible.vim
Normal file
1
ftdetect/ansible.vim
Normal file
@@ -0,0 +1 @@
|
||||
au BufRead,BufNewFile *.yml set filetype=yaml.ansible
|
@@ -30,6 +30,9 @@ return {
|
||||
"ansiblels",
|
||||
"terraformls",
|
||||
"pylsp",
|
||||
"bashls",
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
@@ -50,12 +53,12 @@ return {
|
||||
executionEnvironment = { enabled = false },
|
||||
validation = {
|
||||
enabled = false,
|
||||
-- lint = { enabled = true, path = 'ansible-lint' },
|
||||
lint = { enabled = true, path = 'ansible-lint' },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = { 'yaml', 'yml', 'ansible' },
|
||||
root_dir = lspconfig.util.root_pattern("roles", "playbooks", "Documents"),
|
||||
root_dir = lspconfig.util.root_pattern("roles", "playbooks"),
|
||||
single_file_support = false,
|
||||
})
|
||||
end,
|
||||
@@ -70,17 +73,15 @@ return {
|
||||
})
|
||||
end,
|
||||
|
||||
["terraformls"] = function ()
|
||||
["bashls"] = function ()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig["terraformls"].setup({
|
||||
cmd = {"terraform-ls", "server"},
|
||||
filetypes = { 'terraform', 'terraform-vars', 'tf', 'hcl' },
|
||||
root_dir = lspconfig.util.root_pattern("Documents"),
|
||||
lspconfig["bashls"].setup({
|
||||
cmd = { "bash-language-server", "start" },
|
||||
filetypes = { 'bash', 'sh' },
|
||||
single_file_support = false,
|
||||
})
|
||||
end,
|
||||
|
||||
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup {
|
||||
@@ -131,4 +132,4 @@ return {
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ return {
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"vimdoc", "lua", "bash", "yaml", "terraform", "hcl", "python",
|
||||
"vimdoc", "lua", "bash", "yaml", "terraform", "hcl", "python", "dockerfile",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
|
@@ -1,8 +1,13 @@
|
||||
-- For some reason the lua lsp thinks that vim. is a undefined global :| just ignore when it tells you lies.
|
||||
-- Settings leader as space. Leader is requred for all custom keybinds
|
||||
vim.g.mapleader = " "
|
||||
-- Enters netrw/file explore in nvim
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
-- Creating keybinds for using tabs
|
||||
vim.keymap.set("n", "<leader>ct", vim.cmd.tabnew)
|
||||
vim.keymap.set("n", "<leader>qt", vim.cmd.tabclose)
|
||||
|
||||
-- Lests you move visual marked blocks up and down
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
@@ -24,4 +29,4 @@ vim.keymap.set("n", "<leader>Y", [["+Y]])
|
||||
-- Ctrl-c remap to Esc
|
||||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
|
@@ -4,6 +4,7 @@ vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.swapfile = false
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
|
Reference in New Issue
Block a user