Compare commits
6 commits
bd9f34c769
...
c41d64b6e3
Author | SHA1 | Date | |
---|---|---|---|
c41d64b6e3 | |||
65ac818a43 | |||
7a6f80cf69 | |||
154cbd76a6 | |||
587131d09d | |||
c7e75819fb |
9 changed files with 114 additions and 27 deletions
|
@ -1,10 +1,18 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
CONFIG_ROOT="${XDG_CONFIG_HOME:-null}"
|
||||||
|
|
||||||
|
if [[ "${CONFIG_ROOT}" == "null" ]]; then
|
||||||
|
CONFIG_ROOT="${HOME}/.config"
|
||||||
|
fi
|
||||||
|
|
||||||
ROOT_DIR="$( cd "$( dirname $0 )/.." && pwd )"
|
ROOT_DIR="$( cd "$( dirname $0 )/.." && pwd )"
|
||||||
NEOVIM_CONFIG_SOURCE_DIR="${ROOT_DIR}/nvim"
|
NEOVIM_CONFIG_SOURCE_DIR="${ROOT_DIR}/nvim"
|
||||||
NEOVIM_CONFIG_DESTINATION_DIR="${XDG_CONFIG_HOME}/nvim"
|
NEOVIM_CONFIG_DESTINATION_DIR="${CONFIG_ROOT}/nvim"
|
||||||
VERSION="$( git describe --tags | tr -d '\n' )"
|
VERSION="$( git describe --tags | tr -d '\n' )"
|
||||||
PROJECT_NAME="nvim.d"
|
PROJECT_NAME="nvim.d"
|
||||||
CODEFLOW_GROUP="linux-home"
|
CODEFLOW_GROUP="linux-home"
|
||||||
|
@ -14,26 +22,26 @@ action="$1"
|
||||||
function backup {
|
function backup {
|
||||||
if [ -d "${NEOVIM_CONFIG_DESTINATION_DIR}" ]; then
|
if [ -d "${NEOVIM_CONFIG_DESTINATION_DIR}" ]; then
|
||||||
echo "[INFO] backing up existing config..."
|
echo "[INFO] backing up existing config..."
|
||||||
timestamp=$( date +"%Y.%m.%dT%H.%M.%S" )
|
TIMESTAMP=$( date +"%Y.%m.%dT%H.%M.%S" )
|
||||||
backup_dir="${ROOT_DIR}/backup"
|
BACKUP_DIR="${ROOT_DIR}/backup"
|
||||||
mkdir -p ${backup_dir}
|
mkdir -p "${BACKUP_DIR}"
|
||||||
cd ${NEOVIM_CONFIG_DESTINATION_DIR}
|
cd "${NEOVIM_CONFIG_DESTINATION_DIR}"
|
||||||
tar czf "${backup_dir}/neovim-config-${timestamp}.tar.gz" .
|
tar czf "${BACKUP_DIR}/neovim-config-${TIMESTAMP}.tar.gz" .
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean {
|
function clean {
|
||||||
rm -f ${NEOVIM_CONFIG_DESTINATION_DIR}/init.lua
|
rm -f "${NEOVIM_CONFIG_DESTINATION_DIR}/init.lua"
|
||||||
find ${NEOVIM_CONFIG_DESTINATION_DIR} -maxdepth 1 -mindepth 1 -type d -not -iwholename "*/plugin" | xargs rm -rf
|
find "${NEOVIM_CONFIG_DESTINATION_DIR}" -maxdepth 1 -mindepth 1 -type d -not -iwholename "*/plugin" | xargs rm -rf
|
||||||
}
|
}
|
||||||
|
|
||||||
function update {
|
function install {
|
||||||
mkdir -p ${NEOVIM_CONFIG_DESTINATION_DIR}
|
mkdir -p "${NEOVIM_CONFIG_DESTINATION_DIR}"
|
||||||
|
|
||||||
# Syncing the neovim configuration files
|
# Syncing the neovim configuration files
|
||||||
echo "[INFO] Syncing ${NEOVIM_CONFIG_SOURCE_DIR} to ${NEOVIM_CONFIG_DESTINATION_DIR}..."
|
echo "[INFO] Syncing ${NEOVIM_CONFIG_SOURCE_DIR} to ${NEOVIM_CONFIG_DESTINATION_DIR}..."
|
||||||
rsync -avh ${NEOVIM_CONFIG_SOURCE_DIR}/ ${NEOVIM_CONFIG_DESTINATION_DIR}
|
rsync -avh "${NEOVIM_CONFIG_SOURCE_DIR}/" "${NEOVIM_CONFIG_DESTINATION_DIR}"
|
||||||
chmod a-rwx,u+rwx ${NEOVIM_CONFIG_DESTINATION_DIR}
|
chmod a-rwx,u+rwx "${NEOVIM_CONFIG_DESTINATION_DIR}"
|
||||||
|
|
||||||
# Ensuring the state directories are present
|
# Ensuring the state directories are present
|
||||||
mkdir -p ${XDG_STATE_HOME}/nvim/{backup,swap,undo,view} ${XDG_STATE_HOME}/logs/nvim ${XDG_DATA_HOME}/nvim/spell
|
mkdir -p ${XDG_STATE_HOME}/nvim/{backup,swap,undo,view} ${XDG_STATE_HOME}/logs/nvim ${XDG_DATA_HOME}/nvim/spell
|
||||||
|
@ -64,8 +72,8 @@ case ${action} in
|
||||||
clean)
|
clean)
|
||||||
clean
|
clean
|
||||||
;;
|
;;
|
||||||
update)
|
install)
|
||||||
update
|
install
|
||||||
;;
|
;;
|
||||||
package)
|
package)
|
||||||
package
|
package
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -3,8 +3,8 @@
|
||||||
backup:
|
backup:
|
||||||
@bash ./.helpers/config backup
|
@bash ./.helpers/config backup
|
||||||
|
|
||||||
update:
|
install:
|
||||||
@bash ./.helpers/config update
|
@bash ./.helpers/config install
|
||||||
|
|
||||||
clean: backup
|
clean: backup
|
||||||
@bash ./.helpers/config clean
|
@bash ./.helpers/config clean
|
||||||
|
|
70
README.asciidoc
Normal file
70
README.asciidoc
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
= nvim.d
|
||||||
|
|
||||||
|
My Neovim configuration for neovim version 0.9.0+.
|
||||||
|
|
||||||
|
== Dependencies
|
||||||
|
|
||||||
|
== Installation
|
||||||
|
|
||||||
|
1. Clone the repository or download the latest package from the release page.
|
||||||
|
2. If you have existing neovim configuration you can take a backup of it.
|
||||||
|
Run the command below to create a timestamped tar archive of your existing config.
|
||||||
|
```
|
||||||
|
make backup
|
||||||
|
```
|
||||||
|
- install config with your XDG_CONIFIG_HOME dir (default is ~/.config)
|
||||||
|
```
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
- install the lazy package manager
|
||||||
|
```
|
||||||
|
make install_lazy
|
||||||
|
```
|
||||||
|
- start neovim. when first launched the lazy package manager will proceed to install all missing plugins.
|
||||||
|
|
||||||
|
== Plugins
|
||||||
|
|
||||||
|
[%header,cols=3*]
|
||||||
|
|===
|
||||||
|
|Name
|
||||||
|
|Purpose
|
||||||
|
|Link to source
|
||||||
|
|
||||||
|
|folke/lazy.nvim
|
||||||
|
|Manages all other neovim plugins.
|
||||||
|
|https://github.com/folke/lazy.nvim
|
||||||
|
|
||||||
|
|folke/tokyonight.nvim
|
||||||
|
|Sets the Tokyonight colour scheme for neovim.
|
||||||
|
|https://github.com/folke/tokyonight.nvim
|
||||||
|
|
||||||
|
|neovim/nvim-lspconfig
|
||||||
|
|Makes configuring LSP settings in neovim much easier.
|
||||||
|
|https://github.com/neovim/nvim-lspconfig
|
||||||
|
|
||||||
|
|nvim-treesitter/nvim-treesitter
|
||||||
|
|An interface for treesitter to provide better highlighting among other functionalities.
|
||||||
|
|https://github.com/nvim-treesitter/nvim-treesitter
|
||||||
|
|
||||||
|
|akinsho/bufferline.nvim
|
||||||
|
|For visualising buffers and easy navigation between them.
|
||||||
|
|https://github.com/akinsho/bufferline.nvim
|
||||||
|
|
||||||
|
|nvim-tree/nvim-web-devicons
|
||||||
|
|Provides icons that are used in other plugins.
|
||||||
|
|https://github.com/nvim-tree/nvim-web-devicons
|
||||||
|
|
||||||
|
|is0n/tui-nvim
|
||||||
|
|Allows you to open terminal programs in neovim. Currently used to integration the LF file manager within neovim.
|
||||||
|
|https://github.com/is0n/tui-nvim
|
||||||
|
|
||||||
|
|mfussenegger/nvim-lint
|
||||||
|
|An asynchronous linter plugin complementary to the LSP client. Used for external linters such as golangci-lint and pyls.
|
||||||
|
|https://github.com/mfussenegger/nvim-lint
|
||||||
|
|===
|
||||||
|
|
||||||
|
== Key mappings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
== Compatibility
|
|
@ -1,3 +0,0 @@
|
||||||
# neovim-config
|
|
||||||
|
|
||||||
Neovim configuration for neovim version 0.8.2+.
|
|
|
@ -2,3 +2,4 @@ require("options")
|
||||||
require("plugins")
|
require("plugins")
|
||||||
require("keymappings")
|
require("keymappings")
|
||||||
require("autocommands")
|
require("autocommands")
|
||||||
|
require("ftdetect")
|
||||||
|
|
1
nvim/lua/ftdetect/init.lua
Normal file
1
nvim/lua/ftdetect/init.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
require("ftdetect.jsonnet")
|
|
@ -11,7 +11,6 @@ bufferline.setup{
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
show_buffer_close_icons = false,
|
show_buffer_close_icons = false,
|
||||||
show_buffer_default_icon = true,
|
|
||||||
show_close_icon = false,
|
show_close_icon = false,
|
||||||
show_tab_indicators = true,
|
show_tab_indicators = true,
|
||||||
separator_style = "slant",
|
separator_style = "slant",
|
||||||
|
@ -29,5 +28,9 @@ bufferline.setup{
|
||||||
numbers = function(opts)
|
numbers = function(opts)
|
||||||
return string.format("[%s]%s", opts.id, opts.raise(opts.ordinal))
|
return string.format("[%s]%s", opts.id, opts.raise(opts.ordinal))
|
||||||
end,
|
end,
|
||||||
|
get_element_icon = function(element)
|
||||||
|
local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false })
|
||||||
|
return icon, hl
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,9 @@ vim.opt.runtimepath:prepend(lazypath)
|
||||||
|
|
||||||
local plugins = {
|
local plugins = {
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/folke/tokyonight.nvim
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
tag = "v2.1.0", -- 2023-08-29
|
tag = "v3.0.1", -- 2024-01-21
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.tokyonight")
|
require("plugins.config.tokyonight")
|
||||||
|
@ -17,15 +18,17 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/neovim/nvim-lspconfig
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
commit = "10fa01d553ce10646350461ac5ddc71f189e9d1a", -- 2023-04-10
|
tag = "v0.1.8", -- 2024-05-21
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.lsp")
|
require("plugins.config.lsp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/nvim-treesitter/nvim-treesitter
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
commit = "cc360a9beb1b30d172438f640e2c3450358c4086", -- 2023-04-10
|
commit = "f0e3b5c5fe38d0012c63368db90017fef87c85a2", -- 2024-06-29
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.treesitter")
|
require("plugins.config.treesitter")
|
||||||
end,
|
end,
|
||||||
|
@ -34,12 +37,14 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/nvim-tree/nvim-web-devicons
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
commit = "f16ec8f6e5d23e4349501dae46e0a661918e086e", -- 2023-04-08
|
commit = "c0cfc1738361b5da1cd0a962dd6f774cc444f856", -- 2024-06-09
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/akinsho/bufferline.nvim
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
tag = "v3.6.0", -- 2023.03.30
|
tag = "v4.6.1", -- 2024.05.21
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
|
@ -48,6 +53,7 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/is0n/tui-nvim
|
||||||
"is0n/tui-nvim",
|
"is0n/tui-nvim",
|
||||||
commit = "2eeff3ac921f53bdb837d23d6e4501d97807994c", -- 2022.05.07
|
commit = "2eeff3ac921f53bdb837d23d6e4501d97807994c", -- 2022.05.07
|
||||||
config = function()
|
config = function()
|
||||||
|
@ -55,8 +61,9 @@ local plugins = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
-- Source: https://github.com/mfussenegger/nvim-lint
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
commit = "67f74e630a84ecfa73a82783c487bdedd8cecdc3", -- 2023.09.21
|
commit = "efc6fc83f0772283e064c53a8f9fb5645bde0bc0", -- 2024.06.26
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.lint")
|
require("plugins.config.lint")
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in a new issue