Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Display line numbers in vim. If a file is open with vim press ESC (if you are in insert mode) and then press colon (:) and type:

set number


The above command will print line numbers in front of each line.

Now if you want to hide line numbers you just need to press colon again and type:

set nonumber


#vim #tricks #line_number #nonumber #number
How to get only numbers in textbox using jQuery?

// Restricts input for each element in the set of matched elements to the given inputFilter.
(function($) {
$.fn.inputFilter = function(inputFilter) {
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
if (inputFilter(this.value)) {
this.oldValue = this.value;
this.oldSelectionStart = this.selectionStart;
this.oldSelectionEnd = this.selectionEnd;
} else if (this.hasOwnProperty("oldValue")) {
this.value = this.oldValue;
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
}
});
};
}(jQuery));

// restrict input to receive just numbers
$("#my_input_num").inputFilter(function(value) {
return /^\d*$/.test(value);
});

#javascript #jquery #input #number