Skip to content

Commit

Permalink
Features/zsh notes and releases (#76)
Browse files Browse the repository at this point in the history
* Centralize posix configs in .config/posix-shell and add zsh support

* Add RELEASE file to project

* Adjust shells and main README

* Add prepare build script to CI

* Remove .gitignore from Dockerfile and prepare_build and add to .stow-local-ignore

* Fix tmux conf filename

* Localize lsp plugins in lua/plugins/lsp

* Switch Dockerfile nvim to stable

* Fix lsp formatting, lua language server and completion capbilities

* Remove github workflows until there's a better plan to test

* Add Containerfile and update README

* Shots fired

* Remove CI specific scripts (for now..)

* Remove RELEASE file until automated releases are implemented
  • Loading branch information
EnriqueVidal authored Feb 27, 2023
1 parent cec5ce6 commit 152ea20
Show file tree
Hide file tree
Showing 26 changed files with 346 additions and 213 deletions.
44 changes: 0 additions & 44 deletions .bash_profile

This file was deleted.

17 changes: 16 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
source ~/.bash_profile
export SHELL=bash

source ~/.config/posix-shell/profile

shopt -s histappend

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
36 changes: 0 additions & 36 deletions .config/bash/README.md

This file was deleted.

8 changes: 4 additions & 4 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ for _, source in pairs({
"plugins.lualine", -- statusline
"plugins.nvim-tree", -- file explorer
"plugins.treesitter", -- treesitter
"plugins.lsp-config", -- laguage server protocol config
"plugins.mason", -- automatic language server installer
"plugins.telescope", -- fuzzy finder
"plugins.nvim-cmp", -- nvim completion
"plugins.null-ls", -- formatter and diagnostics
"plugins.lsp.mason", -- automatic language server installer
"plugins.lsp.lsp-config", -- laguage server protocol config
"plugins.lsp.nvim-cmp", -- nvim completion
"plugins.lsp.null-ls", -- formatter and diagnostics
"plugins.gitsigns", -- git commands
}) do
local present, fault = pcall(require, source)
Expand Down
105 changes: 0 additions & 105 deletions .config/nvim/lua/plugins/lsp-config.lua

This file was deleted.

107 changes: 107 additions & 0 deletions .config/nvim/lua/plugins/lsp/lsp-config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
local lspconfig_ok, lspconfig = pcall(require, "lspconfig")

if not lspconfig_ok then
return
end

-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)

-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(_, bufnr)
-- Enable completion triggered by <c-x><c-o>
-- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')

-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
vim.keymap.set("n", "<space>f", function()
vim.lsp.buf.format({ async = true })
end, bufopts)
end

local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}

lspconfig.dockerls.setup({
on_attach = on_attach,
flags = lsp_flags,
})

lspconfig.hls.setup({
on_attach = on_attach,
flags = lsp_flags,
cmd = { "haskell-language-server-wrapper", "--lsp" },
filetypes = { "haskell", "lhaskell" },

-- Server specific settings...
settings = {
["haskell"] = {
formattingProvider = "hfmt",
},
},
})

lspconfig.pyright.setup({
on_attach = on_attach,
flags = lsp_flags,
})

lspconfig.rust_analyzer.setup({
on_attach = on_attach,
flags = lsp_flags,
-- Server-specific settings...
settings = {
["rust-analyzer"] = {},
},
})

lspconfig.tsserver.setup({
on_attach = on_attach,
flags = lsp_flags,
})

lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "use", "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
})
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if not (cmp_lsp_ok and lspconfig_ok) then
end
-- Add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = cmp_nvim_lsp.update_capabilities(capabilities)
capabilities = cmp_nvim_lsp.default_capabilities(capabilities)

-- Enable some language servers with the additional completion Capabilities
local servers = { "hls", "pyright", "rust_analyzer", "tsserver" }
Expand Down
25 changes: 20 additions & 5 deletions .config/nvim/lua/plugins/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,31 @@ return packer.startup(function()
requires = { "kyazdani42/nvim-web-devicons", opt = true },
})

-- autocomplete
use("hrsh7th/cmp-nvim-lsp") -- LSP source for nvim-cmp
use("hrsh7th/nvim-cmp") -- Auto completion plugin

-- managing & installing lsp servers, linters & formatters
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")

-- LSP
use("neovim/nvim-lspconfig") -- Collection of configuration for LSP
use("williamboman/mason.nvim") -- Language Server Auto installation
use("hrsh7th/nvim-cmp") -- Auto completion plugin
use("hrsh7th/cmp-nvim-lsp") -- LSP source for nvim-cmp
use("saadparwaiz1/cmp_luasnip") -- Snippets source for nvim-cmp
use({ "glepnir/lspsaga.nvim", branch = "main" }) -- Enhanced LSP UIs
use("onsails/lspkind.nvim") -- LSP UIs icons

-- Snippets
use("L3MON4D3/LuaSnip") -- Snippets plugin
use("saadparwaiz1/cmp_luasnip") -- Snippets source for nvim-cmp

-- Syntax highlights
use("nvim-treesitter/nvim-treesitter") -- Treesitter
use({
"nvim-treesitter/nvim-treesitter",
run = function()
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
ts_update()
end,
}) -- Treesitter

-- Collection of lua functions
use("nvim-lua/plenary.nvim")
Expand Down
Loading

0 comments on commit 152ea20

Please sign in to comment.