This file contains hidden or 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
| function backspace(str, symbol) { | |
| let result = [] | |
| for ( let i=0; i<str.length; i++ ) { | |
| chr = (str[i]) | |
| if ( chr == symbol ) { | |
| result.pop() | |
| } else { |
This file contains hidden or 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
| function decipherThis(string) { | |
| string_arr = string.split(' ') // [ "this", "is", "string" ] | |
| result_array = [] | |
| for (i=0; i<string_arr.length; i++) { | |
| word = string_arr[i] | |
| // dealing with char Code | |
| code = [] | |
| word_new = [] |
This file contains hidden or 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
| --If you want to automatically ensure that packer.nvim is installed on any machine you clone your configuration to, | |
| --add the following snippet (which is due to @Iron-E) somewhere in your config before your first usage of packer: | |
| local execute = vim.api.nvim_command | |
| local fn = vim.fn | |
| local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' | |
| if fn.empty(fn.glob(install_path)) > 0 then | |
| fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path}) | |
| execute 'packadd packer.nvim' | |
| end |
This file contains hidden or 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
| --If you want to automatically ensure that packer.nvim is installed on any machine you clone your configuration to, | |
| --add the following snippet (which is due to @Iron-E) somewhere in your config before your first usage of packer: | |
| local execute = vim.api.nvim_command | |
| local fn = vim.fn | |
| local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' | |
| if fn.empty(fn.glob(install_path)) > 0 then | |
| fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path}) | |
| execute 'packadd packer.nvim' | |
| end |
This file contains hidden or 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
| -- options for lsp diagnostic | |
| vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( | |
| vim.lsp.diagnostic.on_publish_diagnostics, { | |
| underline = true, | |
| signs = true, | |
| update_in_insert = true, | |
| virtual_text = { | |
| true, | |
| spacing = 6, | |
| --severity_limit='Error' -- Only show virtual text on error |
This file contains hidden or 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
| require('lspkind').init({ | |
| -- enables text annotations (default: true) | |
| with_text = true, | |
| -- enables text annotations (default: 'default') | |
| -- default symbol map can be either 'default' or 'codicons' for codicon preset (requires vscode-codicons font installed) | |
| preset = 'codicons', | |
| -- override preset symbols (default: {}) | |
| symbol_map = { |
This file contains hidden or 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
| require('lsp-status').status() | |
| require('lsp-status').register_progress() | |
| require('lsp-status').config({ | |
| indicator_errors = '✗', | |
| indicator_warnings = '⚠', | |
| indicator_info = '', | |
| indicator_hint = '', | |
| indicator_ok = '✔', | |
| current_function = true, | |
| diagnostics = false, |
This file contains hidden or 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
| local lsp_installer = require("nvim-lsp-installer") | |
| -- Provide settings first! | |
| lsp_installer.settings { | |
| ui = { | |
| icons = { | |
| server_installed = "✓", | |
| server_pending = "➜", | |
| server_uninstalled = "✗", | |
| }, |
This file contains hidden or 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
| -- Set completeopt to have a better completion experience | |
| vim.o.completeopt = 'menuone,noselect' | |
| local cmp = require'cmp' | |
| cmp.setup({ | |
| completion = { | |
| --completeopt = 'menu,menuone,noinsert', | |
| }, | |
| snippet = { | |
| expand = function(args) |
This file contains hidden or 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
| local ls = require("luasnip") | |
| -- some shorthands... | |
| local s = ls.snippet | |
| local sn = ls.snippet_node | |
| local t = ls.text_node | |
| local i = ls.insert_node | |
| local f = ls.function_node | |
| local c = ls.choice_node | |
| local d = ls.dynamic_node |
OlderNewer