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
1. Create file init.lua in C:\Users\your_name\AppData\Local\nvim\init.lua | |
2. Add to file init.lua parameters for tabs (for Python I use 4 spaces for identation): | |
vim.cmd("set expandtab") | |
vim.cmd("set tabstop=4") | |
vim.cmd("set softtabstop=4") | |
vim.cmd("set shiftwidth=4") | |
3. Add to init.lua configuration for lazy.nvim package manager | |
https://lazy.folke.io/installation |
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
set number | |
set relativenumber | |
call plug#begin('~/.vim/plugged') | |
Plug 'morhetz/gruvbox' | |
Plug 'vim-airline/vim-airline' | |
Plug 'preservim/nerdtree' | |
Plug 'ryanoasis/vim-devicons' |
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
require 'active_model' | |
class Superhero | |
include ActiveModel::Validations | |
@@total = [] | |
attr_reader :name, :age | |
def initialize name, age | |
@name = name |
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
class Arsenal | |
def self.hello | |
'Hello as class method!' | |
end | |
def mymy | |
'Arsen Wenger' | |
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
require 'active_model' | |
class Superhero | |
include ActiveModel::Validations | |
attr_accessor :name, :age | |
def initialize **args | |
@name = args[:name] |
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
module ActsAsWalker | |
attr_reader :distance | |
def walk! | |
@distance += 1 | |
end | |
end | |
module ActsAsSpeaker | |
attr_reader :speak, :gills |
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
ar = [1, 2, 4] | |
def square_values array | |
array.map! {|e| e * e } | |
end | |
p square_values ar |
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
def summarize *args | |
"#{args[0]} #{args[1]} #{args[2]}" | |
end | |
p summarize 1,2,3,4,5 |
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
def hello_message options = {} | |
first_name = options.fetch :first_name | |
last_name = options.fetch :last_name | |
"Hello, #{first_name} #{last_name}" | |
end | |
data = {first_name: 'Lero4ka', last_name: 'Melnik' } | |
# p hello_message data |
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
require 'active_model' | |
class Person | |
include ActiveModel::Validations | |
attr_accessor :name, :age, :size | |
def initialize name: nil, age: nil, size: nil | |
@name = name | |
@age = age |
NewerOlder