-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Title: Added autocompletion & other improvements.
Description: Added autocompletion feature using nvim-cmp plugin and customised it with better aesthetics. Reorganised the file structures and rice it even further. Improved calls with protections. Optimised the code and added some other improvements. CID: #7
- Loading branch information
1 parent
e9f2cb1
commit 80d73f1
Showing
12 changed files
with
512 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Notes | ||
This file will contain some useful information about Nvim and Lua! | ||
|
||
|
||
## Protected calls | ||
You would have seen below code snippet. | ||
``` | ||
local status_ok, configs = pcall(require, "pluginname") | ||
if not status_ok then | ||
return | ||
else | ||
-- Do something | ||
end | ||
``` | ||
|
||
How do you get this 'pluginname' if you didn't it from the documentation? | ||
Remember it is not always the directory name or the git repo name. | ||
|
||
Ok, so here is how to get it in case where repo name or directory name doesn't | ||
work. Inside nvim, type | ||
``` | ||
: set rtp? | ||
``` | ||
|
||
It will show the runtime path of all the plugins. These can be used for those | ||
protected calls. | ||
|
||
|
||
## Pretty cool websites | ||
https://github.com/rockerBOO/awesome-neovim | ||
https://neovimcraft.com | ||
https://dotfyle.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--****************************************************************************-- | ||
--* [draculaconfig.lua] *-- | ||
--* [THEME DRACULA CONFIG FILE] *-- | ||
--* [Author/Credit - Tanweer Ashif] *-- | ||
--* [LinkedIn/tanweerashif | GitHub/HacksPloiter | https://tanweerashif.com] *-- | ||
--****************************************************************************-- | ||
|
||
|
||
--================================-> START <-=================================-- | ||
-- Theme Dracula Configs -- | ||
-------------------------------------------------------------------------------- | ||
local status_ok, configs = pcall(require, "dracula") | ||
if not status_ok then | ||
return | ||
else | ||
-- vim.opt.syntax = "ON" | ||
-- vim.opt.termguicolors = true | ||
-- vim.cmd 'colorscheme dracula' | ||
end | ||
--================================-> END <-===================================-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--****************************************************************************-- | ||
--* [lualineconfig.lua] *-- | ||
--* [PLUGIN LUALINE CONFIG FILE] *-- | ||
--* [Author/Credit - Tanweer Ashif] *-- | ||
--* [LinkedIn/tanweerashif | GitHub/HacksPloiter | https://tanweerashif.com] *-- | ||
--****************************************************************************-- | ||
|
||
|
||
--================================-> START <-=================================-- | ||
-- Plugin Lualine Configs -- | ||
-------------------------------------------------------------------------------- | ||
local status_ok, configs = pcall(require, "lualine") | ||
if not status_ok then | ||
return | ||
else | ||
--[==[ | ||
-- Filename colour changes based on edits. | ||
local custom_fname = require('lualine.components.filename'):extend() | ||
--custom_fname.apply_icon = require('lualine.components.filetype').apply_icon | ||
local highlight = require'lualine.highlight' | ||
local default_status_colors = { saved = 'none', modified = 'white' } | ||
function custom_fname:init(options) | ||
custom_fname.super.init(self, options) | ||
self.status_colors = { | ||
saved = highlight.create_component_highlight_group({ | ||
bg = default_status_colors.saved}, | ||
'filename_status_saved', self.options), | ||
modified = highlight.create_component_highlight_group({ | ||
bg = default_status_colors.modified}, | ||
'filename_status_modified', self.options), | ||
} | ||
if self.options.color == nil then self.options.color = '' end | ||
end | ||
function custom_fname:update_status() | ||
local data = custom_fname.super.update_status(self) | ||
data = highlight.component_format_highlight( | ||
vim.bo.modified and | ||
self.status_colors.modified or | ||
self.status_colors.saved) .. data | ||
return data | ||
end | ||
]==] | ||
configs.setup { | ||
options = { | ||
icons_enabled = true, | ||
theme = 'molokai', | ||
component_separators = { left = '', right = ''}, | ||
section_separators = { left = '', right = ''}, | ||
disabled_filetypes = { | ||
statusline = {}, | ||
winbar = {}, | ||
}, | ||
ignore_focus = {}, | ||
always_divide_middle = true, | ||
globalstatus = false, | ||
refresh = { | ||
statusline = 1000, | ||
tabline = 1000, | ||
winbar = 1000, | ||
} | ||
}, | ||
sections = { | ||
lualine_a = {'mode'}, | ||
lualine_b = {'branch', 'diff', 'diagnostics'}, | ||
-- lualine_c = {custom_fname}, | ||
lualine_c = {'filename'}, | ||
lualine_x = {'encoding', 'fileformat', 'filetype'}, | ||
lualine_y = {'progress'}, | ||
lualine_z = {'location'} | ||
}, | ||
inactive_sections = { | ||
lualine_a = {}, | ||
lualine_b = {}, | ||
lualine_c = {'filename'}, | ||
lualine_x = {'location'}, | ||
lualine_y = {}, | ||
lualine_z = {} | ||
}, | ||
tabline = { | ||
lualine_a = {'filename'}, | ||
lualine_b = {}, | ||
lualine_c = {}, | ||
lualine_x = {}, | ||
lualine_y = {}, | ||
lualine_z = {}, | ||
}, | ||
winbar = {}, | ||
inactive_winbar = {}, | ||
extensions = {}, | ||
} | ||
end | ||
--================================-> END <-===================================-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--****************************************************************************-- | ||
--* [lunarconfig.lua] *-- | ||
--* [THEME LUNAR CONFIG FILE] *-- | ||
--* [Author/Credit - Tanweer Ashif] *-- | ||
--* [LinkedIn/tanweerashif | GitHub/HacksPloiter | https://tanweerashif.com] *-- | ||
--****************************************************************************-- | ||
|
||
|
||
--================================-> START <-=================================-- | ||
-- Theme LunarVim Configs -- | ||
-------------------------------------------------------------------------------- | ||
local status_ok, configs = pcall(require, "lunar") | ||
if not status_ok then | ||
return | ||
else | ||
-- vim.cmd 'colorscheme lunar' | ||
end | ||
--================================-> END <-===================================-- |
Oops, something went wrong.